in reply to Re^4: Pattern Matching in Arrays
in thread Pattern Matching in Arrays
I liked the split method recommended above.
Unfortunately it doesn't work with multiple underscores.
If you want to stick with regexp, then try this:
if (/^(.*?)(?:_([^_]*))?\.pdf$/) { # do something with $1 and $2 }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: Pattern Matching in Arrays
by aj.kohler (Initiate) on May 13, 2009 at 18:28 UTC |