X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=samples%2Fwc2re.pl;h=b3336f744192122f56f7c7b4499700d8eefd3781;hb=39b3bffa90cd07a8edd6ff9e22481bc61c33dd6a;hp=4c6c3404e80d882c9184f9eb979a99f5e5957cc8;hpb=46111541589202352d6a6a665eb03fe24e3861a6;p=perl%2Fmodules%2FRegexp-Wildcards.git diff --git a/samples/wc2re.pl b/samples/wc2re.pl index 4c6c340..b3336f7 100755 --- a/samples/wc2re.pl +++ b/samples/wc2re.pl @@ -3,9 +3,16 @@ use strict; use warnings; -use Regexp::Wildcards qw/wc2re/; +use lib qw{blib/lib}; -my $type = (grep $^O eq $_, qw/dos os2 MSWin32 cygwin/) ? 'win32' : 'unix'; +use Regexp::Wildcards; +use Data::Dumper; -print "For this system, type is $type\n"; -print $_, ' => ', wc2re($_ => $type), "\n" for @ARGV; +my $rw = Regexp::Wildcards->new( + do => [ qw/brackets/ ], + capture => [ qw/single/ ], +); +$rw->do(add => [ qw/jokers/ ]); +$rw->capture(add => [ qw/brackets any greedy/ ]); + +print $_, ' => ', $rw->convert($_), "\n" for @ARGV;