in reply to RegEx Headaches
x /(\d+)\.(\d+)\.xml/ [download]
-Scott
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 [download]
I thought the g would do that, but I guess not.
One way to do it.
DB<1> $_ = 'ActionLogs.1.2.3.4.5.6.7.8.9.xml' 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> [download]
Update: The brackets are unnecessary; tr/.a-zA-Z/ /dr works just as well.