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

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

by BillKSmith (Deacon)
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 musing on the Monastery: (13)
As of 2015-04-01 16:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Who makes your decisions?







    Results (31 votes), past polls