X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FRegexp-Wildcards.git;a=blobdiff_plain;f=samples%2Fwc2re.pl;h=0afc1268a8163b1de5a42fe59abd5f5793dbf72c;hp=4c6c3404e80d882c9184f9eb979a99f5e5957cc8;hb=fbd767d1d92b735a6509e57ccfbd73b45845081e;hpb=46111541589202352d6a6a665eb03fe24e3861a6 diff --git a/samples/wc2re.pl b/samples/wc2re.pl index 4c6c340..0afc126 100755 --- a/samples/wc2re.pl +++ b/samples/wc2re.pl @@ -3,9 +3,20 @@ 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/ ], +); + +use Data::Dumper; +print Dumper($rw); + +$rw->capture(add => [ qw/brackets any greedy/ ]); +print Dumper($rw); + +print $_, ' => ', $rw->convert($_), "\n" for @ARGV;