"Vincent Pit <perl@profvince.com>"
],
"dynamic_config" : 0,
- "generated_by" : "ExtUtils::MakeMaker version 6.59, CPAN::Meta::Converter version 2.112150",
+ "generated_by" : "ExtUtils::MakeMaker version 6.72, CPAN::Meta::Converter version 2.132140",
"license" : [
"perl_5"
],
"prereqs" : {
"build" : {
"requires" : {
- "Carp" : 0,
- "ExtUtils::MakeMaker" : 0,
- "Scalar::Util" : 0,
- "Test::More" : 0,
- "Text::Balanced" : 0
+ "Carp" : "0",
+ "ExtUtils::MakeMaker" : "0",
+ "Scalar::Util" : "0",
+ "Test::More" : "0",
+ "Text::Balanced" : "0"
}
},
"configure" : {
"requires" : {
- "ExtUtils::MakeMaker" : 0
+ "ExtUtils::MakeMaker" : "0"
}
},
"runtime" : {
"requires" : {
- "Carp" : 0,
- "Scalar::Util" : 0,
- "Text::Balanced" : 0,
+ "Carp" : "0",
+ "Scalar::Util" : "0",
+ "Text::Balanced" : "0",
"perl" : "5.006"
}
}
"release_status" : "stable",
"resources" : {
"bugtracker" : {
- "web" : "http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Regexp-Wildcards"
+ "web" : "http://rt.cpan.org/Dist/Display.html?Name=Regexp-Wildcards"
},
"homepage" : "http://search.cpan.org/dist/Regexp-Wildcards/",
"license" : [
"url" : "http://git.profvince.com/?p=perl%2Fmodules%2FRegexp-Wildcards.git"
}
},
- "version" : "1.04"
+ "version" : "1.05"
}
expressions.
VERSION
- Version 1.04
+ Version 1.05
SYNOPSIS
use Regexp::Wildcards;
my $re;
$re = $rw->convert('a{b?,c}*'); # Do it Unix shell style.
$re = $rw->convert('a?,b*', 'win32'); # Do it Windows shell style.
- $re = $rw->convert('*{x,y}?', 'jokers'); # Process the jokers and escape the rest.
- $re = $rw->convert('%a_c%', 'sql'); # Turn SQL wildcards into regexps.
+ $re = $rw->convert('*{x,y}?', 'jokers'); # Process the jokers and
+ # escape the rest.
+ $re = $rw->convert('%a_c%', 'sql'); # Turn SQL wildcards into
+ # regexps.
$rw = Regexp::Wildcards->new(
do => [ qw<jokers brackets> ], # Do jokers and brackets.
);
$rw->do(add => 'groups'); # Don't escape groups.
- $rw->capture(rem => [ qw<greedy> ]); # Actually we want non-greedy matches.
+ $rw->capture(rem => [ qw<greedy> ]); # Actually we want non-greedy
+ # matches.
$re = $rw->convert('*a{,(b)?}?c*'); # '(.*?)a(?:|(b).).c(.*?)'
$rw->capture(); # No more captures.
provided.
METHODS
- "new [ do => $what | type => $type ], capture => $captures"
+ "new"
+ my $rw = Regexp::Wildcards->new(do => $what, capture => $capture);
+ my $rw = Regexp::Wildcards->new(type => $type, capture => $capture);
+
Constructs a new Regexp::Wildcard object.
"do" lists all features that should be enabled when converting wildcards
"capture" lists which atoms should be capturing. Refer to "capture" for
more details.
- "do [ $what | set => $c1, add => $c2, rem => $c3 ]"
+ "do"
+ $rw->do($what);
+ $rw->do(set => $c1);
+ $rw->do(add => $c2);
+ $rw->do(rem => $c3);
+
Specifies the list of metacharacters to convert or to prevent for
escaping. They fit into six classes :
$rw->do(set => 'jokers'); # Only translate jokers.
$rw->do('jokers'); # Same.
$rw->do(add => [ qw<sql commas> ]); # Translate also SQL and commas.
- $rw->do(rem => 'jokers'); # Specifying both 'sql' and 'jokers' is useless.
+ $rw->do(rem => 'jokers'); # Specifying both 'sql' and
+ # 'jokers' is useless.
$rw->do(); # Translate nothing.
The "do" method returns the Regexp::Wildcards object.
- "type $type"
+ "type"
+ $rw->type($type);
+
Notifies to convert the metacharacters that corresponds to the
predefined type $type. $type can be any of :
The "type" method returns the Regexp::Wildcards object.
- "capture [ $captures | set => $c1, add => $c2, rem => $c3 ]"
+ "capture"
+ $rw->capture($captures);
+ $rw->capture(set => $c1);
+ $rw->capture(add => $c2);
+ $rw->capture(rem => $c3);
+
Specifies the list of atoms to capture. This method works like "do",
except that the classes are different :
'a{b\\},\\{c}' ==> 'a(b\\}|\\{c)'
- $rw->capture(set => 'single'); # Only capture "exactly one" metacharacters.
+ $rw->capture(set => 'single'); # Only capture "exactly one"
+ # metacharacters.
$rw->capture('single'); # Same.
- $rw->capture(add => [ qw<any greedy> ]); # Also greedily capture "any" metacharacters.
+ $rw->capture(add => [ qw<any greedy> ]); # Also greedily capture
+ # "any" metacharacters.
$rw->capture(rem => 'greedy'); # No more greed please.
$rw->capture(); # Capture nothing.
The "capture" method returns the Regexp::Wildcards object.
- "convert $wc [ , $type ]"
+ "convert"
+ my $rx = $rw->convert($wc);
+ my $rx = $rw->convert($wc, $type);
+
Converts the wildcard expression $wc into a regular expression according
to the options stored into the Regexp::Wildcards object, or to $type if
it's supplied. It successively escapes all unprotected regexp special
<http://www.profvince.com/perl/cover/Regexp-Wildcards>.
COPYRIGHT & LICENSE
- Copyright 2007-2009 Vincent Pit, all rights reserved.
+ Copyright 2007,2008,2009,2013 Vincent Pit, all rights reserved.
This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.