Regexp::GenexRegexp::Genex - get the strings a regex will match, with a regex. | |
Download |
Regexp::Genex Ranking & Summary
Advertisement
- License:
- Perl Artistic License
- Price:
- FREE
- Publisher Name:
- Brad Bowman
- Publisher web site:
- http://search.cpan.org/~bowmanbs/Regexp-Genex-0.07/lib/Regexp/Genex.pm
Regexp::Genex Tags
Regexp::Genex Description
Regexp::Genex - get the strings a regex will match, with a regex. Regexp::Genex - get the strings a regex will match, with a regex.SYNPOSIS # first try: $ perl -MRegexp::Genex=:all -le 'print for strings(qr/a(b|c)d{2,3}e*/)' $ perl -x `pmpath Regexp::Genex`#!/usr/bin/perl -l use Regexp::Genex qw(:all); $regex = shift || "a(b|c)d{2,4}?"; print "Trying: $regex"; print for strings($regex); # abdd # abddd # abdddd # acdd # acddd # acdddd print "nThe regex code for that was:nqr/"; print strings_rx($regex); print "/xn"; my $generator = generator($regex); print "Taking first two using generator"; print $generator->() for 1..2; my $big_rx = 'b*?c*?d*?'; # * becomes {0,20} my $big = generator($big_rx, ($max_length = 100) ); print "Taking string 100 of $big_rx"; print $big->(100); # (caveats below) # ccccdddddddddddddddd NOT 'd'x100 as you may expect Requirements: · Perl
Regexp::Genex Related Software