re::engine::PCRE - Perl-compatible regular expression engine


re-engine-PCRE documentation Contained in the re-engine-PCRE distribution.

Index


Code Index:

NAME

Top

re::engine::PCRE - Perl-compatible regular expression engine

SYNOPSIS

Top

    use re::engine::PCRE;

    if ("Hello, world" =~ /(?<=Hello|Hi), (world)/) {
        print "Greetings, $1!";
    }

DESCRIPTION

Top

Replaces perl's regex engine in a given lexical scope with PCRE regular expressions provided by libpcre.

AUTHORS

Top

Ævar Arnfjörð Bjarmason <avar@cpan.org>

COPYRIGHT

Top


re-engine-PCRE documentation Contained in the re-engine-PCRE distribution.

package re::engine::PCRE;
BEGIN {
  $re::engine::PCRE::AUTHORITY = 'cpan:AVAR';
}
BEGIN {
  $re::engine::PCRE::VERSION = '0.17';
}
use 5.010;
use XSLoader ();

# All engines should subclass the core Regexp package
our @ISA = 'Regexp';

BEGIN
{

    XSLoader::load __PACKAGE__, $VERSION;
}

sub import
{
    $^H{regcomp} = ENGINE;
}

sub unimport
{
    delete $^H{regcomp}
        if $^H{regcomp} == ENGINE;
}

1;

__END__