Regexp::Extended is a Perl wrapper that extends the re module with new features.
SYNOPSIS
use Regexp::Extended qw(:all);
# (?...): named parameters
$date =~ /(?d+)-(?d+)-(?d+)/;
if ("2002-10-30" =~ /$date/) {
print "The date is : $::year->[0]-$::month->[0]-$::day->[0]n";
}
# You can also access individial matches in ()* or ()+
"1234" =~ /(?d)+/;
print "Digit 1 is : $::digit->[0]n";
print "Digit 2 is : $::digit->[1]n";
...
# You can also modify individual matches
"1234" =~ /(?d)+/;
$::digit->[0] = 99;
$::digit->[1] = 88;
print "Modified string is: " . rebuild("1234"); # "998834"
# (?*...): upto a certain pattern
$text = "this is some italic text";
$text =~ /((?*))/; # $1 = "italic"
# (?+...): upto and including a certain pattern
$text = "this is some italic text";
$text =~ /((?+))/; # $1 = "italic"
# You can also use fonctions inside patterns:
sub foo {
return "foo";
}
"foo bar" =~ /((?&foo()))/; # $1 => "foo"
Rexexp::Extended is a simple wrapper arround the perl rexexp syntax. It uses the overload module to parse constant qr// expressions and substitute known operators with an equivalent perl re.
Requirements:
· Perl
Product's homepage
Requirements:
· Perl