NAME
re::engine::Plan9 - Plan9 regular expression engine
SYNOPSIS
use re::engine::Plan9;
if ("bewb" =~ /(.)(.)/) {
print $1; # b
print $2; # e
print $'; # wb
}
DESCRIPTION
Replaces perl's regexes in a given lexical scope with Plan9 regular expression provided by libregexp9. libregexp9 and the libraries it depends on are shipped with the module.
The /s
> flag causes .
to match a newline (regcompnl
) and the /x
flag allegedly causes all characters to be treated literally (regcomplit
), see regexp9(3). No other flags have special meaning to this engine.
If an invalid pattern is supplied perl will die with an error from regerror(3).
CAVEATS
The Plan 9 engine expects the user to supply a pre-allocated buffer to regexec
to hold match variables, however it provides no way to know how many match variables the pattern needs. Currently 50 match variables are allocated for every pattern match (includes $&
so they go up to $49
). Patches that fix the supplied libregexp9 so that it provides this information to its caller welcome.
SEE ALSO
- regexp9(7) - Plan 9 regular expression notation
- regexp9(3) - regcomp, regexec etc.
- Unix Software from Plan 9
- An article by Russ Cox applicable to before the release of this library:)
THANKS
Rafael Kitover (RKITOVER) for the postamble
Makefile.PL section that builds the Plan 9 libraries at make
time.
AUTHOR
Ævar Arnfjörð Bjarmason <avar@cpan.org>
LICENSE
Copyright 2007 Ævar Arnfjörð Bjarmason.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
The included libutf, libfmt and libregexp9 libraries are provided under the following license:
The authors of this software are Rob Pike and Ken Thompson.
Copyright (c) 2002 by Lucent Technologies.
Permission to use, copy, modify, and distribute this software for any
purpose without fee is hereby granted, provided that this entire notice
is included in all copies of any software which is or includes a copy
or modification of this software and in all copies of the supporting
documentation for such software.
THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED
WARRANTY. IN PARTICULAR, NEITHER THE AUTHORS NOR LUCENT TECHNOLOGIES MAKE ANY
REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY
OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.