Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: build regexp on a list of patterns

by borisz (Canon)
on Apr 06, 2005 at 08:20 UTC ( [id://445206]=note: print w/replies, xml ) Need Help??


in reply to build regexp on a list of patterns

use Regexp::Assemble.
use Regexp::Assemble; my @list = ('12341', '12342', '12343', '13341', '13342'); my $ra = Regexp::Assemble->new; $ra->add( @list ); print $ra->re __OUTPUT__ (?-xism:1(?:234[123]|334[12]))
Boris

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2024-03-29 05:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found