Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

Re: RegEx Headaches

by 5mi11er (Deacon)
on Jun 19, 2013 at 18:01 UTC ( #1039815=note: print w/ replies, xml ) Need Help??

in reply to RegEx Headaches

x /(\d+)\.(\d+)\.xml/


Comment on Re: RegEx Headaches
Download Code
Replies are listed 'Best First'.
Re^2: RegEx Headaches
by oryx3 (Novice) on Jun 19, 2013 at 18:46 UTC

    Yes, you answered the question correctly. Unfortunately, it was the wrong question. (That's my fault, not yours.)

    I should have added: the filename can have _one or more_ digit groups separated by periods in the middle. I want to extract them ALL!

    So, for example:


    Should yield

    0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9

    I thought the g would do that, but I guess not.

      One way to do it.

      DB<1> $_ = 'ActionLogs.' DB<2> x split ' ', tr/.[a-zA-Z]/ /dr 0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 DB<3>

      Update: The brackets are unnecessary; tr/.a-zA-Z/ /dr works just as well.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (2)
As of 2015-11-29 22:12 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (753 votes), past polls