Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^2: Matching string containing values between 0 and 100 inclusive

by ikegami (Patriarch)
on Mar 18, 2009 at 13:46 UTC ( [id://751444]=note: print w/replies, xml ) Need Help??


in reply to Re: Matching string containing values between 0 and 100 inclusive
in thread Matching string containing values between 0 and 100 inclusive

You should use Regexp::List from the same for distro when you have strings rather than patterns. It doesn't affect the outcome in this case, but let's not get into the habit of using the wrong tool.

perl -MRegexp::List -le'print Regexp::List->new->list2re(0..100)'

in 5.10 this would bypass demerphq's trie optimisation.

In 5.10, the equivalent of Regexp::Assemble would be:

my $re = join '|', 0..100;

and the equivalent of Regexp::List would be:

my $re = join '|', map quotemeta, 0..100;

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (3)
As of 2024-04-16 14:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found