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

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

Replies are listed 'Best First'.
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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://998756]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (5)
As of 2017-07-21 19:10 GMT
Find Nodes?
    Voting Booth?
    I came, I saw, I ...

    Results (334 votes). Check out past polls.