Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Regex help

by PetaMem (Priest)
on Dec 11, 2012 at 11:43 UTC ( #1008280=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    
    # let's define a sub that will return the matched id IF there was a ma
    +tch, undef else
    ...
    
    my @ids = grep { defined $_ } map { match_id($_) } @lines_from_file;
    
  2. or download this
    
    while ($file_content =~ m{dp/(.\d+?)}g) {  # we have to omit the \z
      print "Found one: $1\n";
    }
    
  3. or download this
    m{dp/([A-Z]\d{8})}g
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (9)
As of 2014-10-22 02:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (112 votes), past polls