re::engine::LPEG - LPEG regular expression engine


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

Index


Code Index:

NAME

Top

re::engine::LPEG - LPEG regular expression engine

SYNOPSIS

Top

    use re::engine::LPEG;

    if ('Hello, world' =~ m{ ( 'Hello' / 'Hi' ) ', ' { 'world' } });
        print "Greetings, $1!";
    }

DESCRIPTION

Top

THIS MODULE IS A FAILURE. THE re-engine INTERFACE IS NOT THE RIGHT WAY TO WRAP LPeg.

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

See "Regex syntax for LPEG", on http://www.inf.puc-rio.br/~roberto/lpeg/re.html.

Common Pitfalls

AUTHORS

Top

François PERRAD <francois.perrad@gadz.org>

HOMEPAGE

Top

The development is hosted at http://code.google.com/p/re-engine-lpeg/.

COPYRIGHT

Top


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

package re::engine::LPEG;
use 5.010000;
use XSLoader ();

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

BEGIN
{
    $VERSION = '0.05';
    XSLoader::load __PACKAGE__, $VERSION;
}

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

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

1;

__END__