re::engine::Oniguruma - Use the Oniguruma regex engine with Perl


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

Index


Code Index:

NAME

Top

re::engine::Oniguruma - Use the Oniguruma regex engine with Perl

SYNOPSIS

Top

    use re::engine::Oniguruma;

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

DESCRIPTION

Top

Replaces perl's regex engine in a given lexical scope with the Oniguruma engine.

See http://www.geocities.jp/kosako3/oniguruma/ for more information.

AUTHORS

Top

Andy Armstrong <andy@hexten.net>

Most of the code was modified from re::engine::PCRE. Thanks to Ævar Arnfjörð Bjarmason for writing it an all his other regex related work.

COPYRIGHT

Top


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

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__