- $re = wc2re 'a{b?,c}*' => 'unix'; # Do it Unix style.
- $re = wc2re 'a?,b*' => 'win32'; # Do it Windows style.
- $re = wc2re '*{x,y}?' => 'jokers'; # Process the jokers & escape the rest.
- $re = wc2re '%a_c%' => 'sql'; # Turn SQL wildcards into regexps.
+ $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.
+
+ $rw = Regexp::Wildcards->new(
+ do => [ qw/jokers brackets/ ], # Do jokers and brackets.
+ capture => [ qw/any greedy/ ], # Capture *'s greedily.
+ );
+
+ $rw->do(add => 'groups'); # Don't escape groups.
+ $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.