Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: grep question

by murugu (Curate)
on Nov 17, 2005 at 05:54 UTC ( #509298=note: print w/replies, xml ) Need Help??


in reply to grep question

Hi darrengan,

If you have a single filename then,

my ($match)=$file=~/(\d{4})\d{4}\.txt/;

If you have multiple filenames and you want to construct array of the results then,

my @a = map {/(\d{4})\d{4}\.txt/} @filenamearray;

Regards,
Murugesan Kandasamy
use perl for(;;);

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (2)
As of 2023-02-04 03:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I prefer not to run the latest version of Perl because:







    Results (30 votes). Check out past polls.

    Notices?