| re-engine-LPEG documentation | Contained in the re-engine-LPEG distribution. |
re::engine::LPEG - LPEG regular expression engine
use re::engine::LPEG;
if ('Hello, world' =~ m{ ( 'Hello' / 'Hi' ) ', ' { 'world' } });
print "Greetings, $1!";
}
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.
split, and not suitable for s///. '/' represents an ordered choice, so the syntax 'm{pattern}' is more
readeable than '/pattern/' where '/' must be escaped. '%' (like in the Lua string library).
See http://www.lua.org/manual/5.1/manual.html#5.4.1.François PERRAD <francois.perrad@gadz.org>
The development is hosted at http://code.google.com/p/re-engine-lpeg/.
Copyright 2008 François PERRAD.
This program is free software; you can redistribute it and/or modify it under the same terms as Lua & LPeg, see http://www.lua.org/license.html.
| 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__