Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: quantifiers with digits (\d{1|2} doesn't do what I expect)

by BillKSmith (Chaplain)
on Aug 21, 2012 at 02:55 UTC ( #988556=note: print w/ replies, xml ) Need Help??


in reply to quantifiers with digits (\d{1|2} doesn't do what I expect)

Use grep

use strict; use warnings; my @array = qw(KL1_something.txt KL12_anything.dat KL123_rest.txt); my @file = grep /^KL\d{1,2}_/, @array; print "@file\n";
Bill


Comment on Re: quantifiers with digits (\d{1|2} doesn't do what I expect)
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (18)
As of 2014-07-23 14:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (144 votes), past polls