Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Generating regex strings with a regex

by bsb (Priest)
on Aug 27, 2003 at 08:47 UTC ( [id://286981]=CUFP: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    /^ab?(c|d)$/ => qw( abc abd ac ad )
    
  2. or download this
    perl -e '""=~/(?{a})(?{$^R.b})?((?{ $^R.c})|(?{ $^R.d}))(?{print "$^R\
    +n"})(?=a)(?!a)/'
    # output:
    ...
    abd
    ac
    ad
    
  3. or download this
    #!/usr/bin/perl -w
    #orig:  reg(ular\s+)?exp?(ression)?!*?
    ...
    (?=a)(?!a)  # fail
    /x;
    __END__
    
  4. or download this
    $ ./genex.pl 
    regular__expression
    ...
    regex
    regex!
    regex!!
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: CUFP [id://286981]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (2)
As of 2024-04-25 21:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found