|Just another Perl shrine|
More Variable length regex issuesby dextius (Monk)
|on Jun 08, 2003 at 23:18 UTC||Need Help??|
dextius has asked for the wisdom of the Perl Monks concerning the following question:
Caveat: Please do not offer split as my solution, this is geared more as a regular expression issue...
Let's use CSV as an example..
The above will only set $1 to "moo".. $2,$3,$4 are all null, $' is "cow", and $& is "foo,bar,moo"
I thought maybe the @- or @+ arrays might contain all of the matches, but to no avail...
What is strange is..
@values will have all the matches I wanted.. But again, $1 will be set, and $2, $3, $4 will all be null.. Are capturing parentheses locked to $1 if matched multiple times? Is there any way around this? (without using split?)
Advance <- Thanks