re::engine::PCR - Pugs::Compiler::Rule regex engine
use 5.10; use re::engine::PCR; if ("abc" =~ q/((.).)./) { say ${^MATCH}; # "abc" say ${^MATCH}->from; # 0 say ${^MATCH}->to; # 3 say ${^MATCH}->[0]; # "ab" say $1; # "ab" (same as above) say ${^MATCH}->[0][0]; # "a" say $1->[0]; # "a" (same as above) }
Replaces the perl regular expression engine in a given lexical scope with the engine provided by Pugs::Compiler::Rule.
Although $& is more succinct than ${^MATCH} using the former (along with $` and $') imposes a considerable performance penalty on all regular expression matches, so don't do that.
$&
${^MATCH}
$`
$'
Sends a SEGV in blead with Pugs::Compiler::Rule 0.22, let's smoke this!
Doesn't handle s/// and split //, see re::engine::Plugin's TODO.
s///
split //
Please report any bugs that aren't already listed at http://rt.cpan.org/Dist/Display.html?Queue=re-engine-PCR to http://rt.cpan.org/Public/Bug/Report.html?Queue=re-engine-PCR
Ævar Arnfjörð Bjarmason <avar@cpan.org>
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.
To install re::engine::PCR, copy and paste the appropriate command in to your terminal.
cpanm
cpanm re::engine::PCR
CPAN shell
perl -MCPAN -e shell install re::engine::PCR
For more information on module installation, please visit the detailed CPAN module installation guide.