Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
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 pondering the Monastery: (6)
As of 2014-07-11 01:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (217 votes), past polls