in reply to RegEx revision needed
It looks like your regex has grown in complexity over time, adding more and more cases. This can create a maintenance nightmare; it's often better just to write out:
or if you need to force leftmost match, like thisif (/case1/) { $capture = $1 } elsif (/case2/) { $capture = $7 } ...
(assuming each case does a separate capture of the part you want).($capture) = grep defined, / (?:case1) | (?:case2) | .../x;
|
|---|