package re::engine::Oniguruma;
require 5.009005;
use strict;
use warnings;
use XSLoader ();
# All engines should subclass the core Regexp package
our @ISA = 'Regexp';
BEGIN {
our $VERSION = '0.04';
XSLoader::load __PACKAGE__, $VERSION;
}
sub import {
$^H{regcomp} = ENGINE;
}
sub unimport {
delete $^H{regcomp}
if $^H{regcomp} == ENGINE;
}
1;
__END__
=head1 NAME
re::engine::Oniguruma - Use the Oniguruma regex engine with Perl
=head1 SYNOPSIS
use re::engine::Oniguruma;
if ("Hello, world" =~ /(?<=Hello), (world)/) {
print "Greetings, $1!";
}
=head1 DESCRIPTION
Replaces perl's regex engine in a given lexical scope with the Oniguruma
engine.
See L for more information.
=head1 AUTHORS
Andy Armstrong
Most of the code was modified from L. Thanks to
Evar ArnfjErE Bjarmason for writing it an all his
other regex related work.
=head1 COPYRIGHT
Copyright 2007, Andy Armstrong
Oniguruma is copyright 2002-2007, K.Kosako
This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.
See F for details of Oniguruma's licence.
=cut