Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

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

by BillKSmith (Priest)
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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://988556]
help
Chatterbox?
[duyet]: Oh, seems like LanX' team has won the fourth World Cup ... awesome!

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (3)
As of 2016-12-10 06:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (160 votes). Check out past polls.