my $re;
$re = $rw->convert('a{b?,c}*'); # Do it Unix shell style.
$re = $rw->convert('a?,b*', 'win32'); # Do it Windows shell style.
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 = Regexp::Wildcards->new(
do => [ qw<jokers brackets> ], # Do jokers and brackets.
$re = $rw->convert('*a{,(b)?}?c*'); # '(.*?)a(?:|(b).).c(.*?)'
$rw->capture(); # No more captures.
$re = $rw->convert('*a{,(b)?}?c*'); # '(.*?)a(?:|(b).).c(.*?)'
$rw->capture(); # No more captures.
- "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
Constructs a new Regexp::Wildcard object.
"do" lists all features that should be enabled when converting wildcards
Specifies the list of metacharacters to convert or to prevent for
escaping. They fit into six classes :
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(set => 'jokers'); # Only translate jokers.
$rw->do('jokers'); # Same.
$rw->do(add => [ qw<sql commas> ]); # Translate also SQL and commas.
Notifies to convert the metacharacters that corresponds to the
predefined type $type. $type can be any of :
Notifies to convert the metacharacters that corresponds to the
predefined type $type. $type can be any of :
- "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 :
Specifies the list of atoms to capture. This method works like "do",
except that the classes are different :
$rw->capture(rem => 'greedy'); # No more greed please.
$rw->capture(); # Capture nothing.
The "capture" method returns the Regexp::Wildcards object.
$rw->capture(rem => 'greedy'); # No more greed please.
$rw->capture(); # Capture nothing.
The "capture" method returns the Regexp::Wildcards object.
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
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
- 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.
This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.