Regexp::MatchContext 0.0.2
Sponsored Links
Regexp::MatchContext 0.0.2 Ranking & Summary
File size:
0.005 MB
Platform:
Any Platform
License:
Perl Artistic License
Price:
Downloads:
1001
Date added:
2007-01-26
Publisher:
Damian Conway
Regexp::MatchContext 0.0.2 description
Regexp::MatchContext is Perl module to replace (and improve) $MATCH, $PREMATCH, and $POSTMATCH
SYNOPSIS
use Regexp::MatchContext -vars;
$str = m/(?p) d+ /;
print "Before: $PREMATCHn";
print "Matched: $MATCHn";
print "After: $POSTMATCHn";
$MATCH = 2 * $MATCH; # substitute into original $str
The English.pm module provides named aliases for Perls built-in $`, $& and $ variables: $PREMATCH, $MATCH, and $POSTMATCH. Unfortunately, those aliases suffer the same problems as their originals: they degrade the performance of every single regex in your program, even if youre only using them to get information about a single match.
This module also provides $PREMATCH, $MATCH, and $POSTMATCH, but in a way that only impacts the performance of matches that you specify. That is, these three variables are only set if the most recently matched regex contained the special (non-standard) meta- flag: (?p).
That is:
use Regexp::MatchContext -vars;
$str = foobarbaz;
$str =~ /(?p) foo /x;
# $PREMATCH contains foo
# $MATCH contains bar
# $POSTMATCH contains baz
$str =~ / foo /x;
# $PREMATCH, $MATCH, and $POSTMATCH all undef
The (?p) marker can be placed anywhere within the regex and, except for setting the three context variables on a successful match, is otherwise totally ignored.
SYNOPSIS
use Regexp::MatchContext -vars;
$str = m/(?p) d+ /;
print "Before: $PREMATCHn";
print "Matched: $MATCHn";
print "After: $POSTMATCHn";
$MATCH = 2 * $MATCH; # substitute into original $str
The English.pm module provides named aliases for Perls built-in $`, $& and $ variables: $PREMATCH, $MATCH, and $POSTMATCH. Unfortunately, those aliases suffer the same problems as their originals: they degrade the performance of every single regex in your program, even if youre only using them to get information about a single match.
This module also provides $PREMATCH, $MATCH, and $POSTMATCH, but in a way that only impacts the performance of matches that you specify. That is, these three variables are only set if the most recently matched regex contained the special (non-standard) meta- flag: (?p).
That is:
use Regexp::MatchContext -vars;
$str = foobarbaz;
$str =~ /(?p) foo /x;
# $PREMATCH contains foo
# $MATCH contains bar
# $POSTMATCH contains baz
$str =~ / foo /x;
# $PREMATCH, $MATCH, and $POSTMATCH all undef
The (?p) marker can be placed anywhere within the regex and, except for setting the three context variables on a successful match, is otherwise totally ignored.
Regexp::MatchContext 0.0.2 Screenshot
Regexp::MatchContext 0.0.2 Keywords
MatchContext
MATCH
POSTMATCH
PREMATCH
MatchContext 0.0.2
to replace
Perl module
module
str
replace
Perl
0.0.2
improve
Regexp::MatchContext
RegexpMatchContext
Regexp::MatchContext 0.0.2
Bookmark Regexp::MatchContext 0.0.2
Regexp::MatchContext 0.0.2 Copyright
WareSeeker periodically updates pricing and software information of Regexp::MatchContext 0.0.2 full version from the publisher, so some information may be slightly out-of-date. You should confirm all information before relying on it. Software piracy is theft, Using crack, password, serial numbers, registration codes, key generators is illegal and prevent future development of Regexp::MatchContext 0.0.2 Edition. Download links are directly from our publisher sites, torrent files or links from rapidshare.com, yousendit.com or megaupload.com are not allowed
Featured Software
Want to place your software product here?
Please contact us for consideration.
Contact WareSeeker.com
Related Information
Related Software
Regexp::Common::time Perl module contains date and time regexps. Free Download
Regexp::Ignore is a Perl module that let us ignore unwanted parts, while parsing text. Free Download
Regexp::Parser is a Perl module for parsing regexes. Free Download
Regexp::Assemble is Perl module to assemble multiple Regular Expressions into a single RE. Free Download
Regexp::Common::net is a Perl module that provide regexes for IPv4 addresses. Free Download
Sub::Regex is a Perl module to create synonymous subroutines. Free Download
Debug::Phases is a Perl module to announce BEGIN and INIT phases to help locate problems. Free Download
regexxer project is a nifty search/replace tool featuring Perl-style regular expressions. Free Download
Latest Software
Popular Software
Favourite Software