Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^3: Another Pattern Matching Question

by surib (Initiate)
on Oct 12, 2012 at 17:43 UTC ( #998756=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Another Pattern Matching Question
in thread Another Pattern Matching Question

Or like this: (I've tried so many combinations I'm confusing myself!)

if ($fileName =~ /3B4[0|1|2]RT\.\d{10}\.7R.bin/) { ($product, $year, $month, $day, $hour, $ver) = ($fileName =~ /(3B4.RT)\.(\d{4})(\d\d)(\d\d)(\d\d)\.(7R)\.bin/); $version = sprintf "%03d", $ver; # a little confusing, $version +is global # $ver is local


Comment on Re^3: Another Pattern Matching Question
Download Code
Re^4: Another Pattern Matching Question
by runrig (Abbot) on Oct 12, 2012 at 17:50 UTC
    If you just want to match 0,1, or 2 and not "|", then your character class should be [012], not [0|1|2].

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (6)
As of 2015-07-03 00:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (47 votes), past polls