in reply to Re^7: /g option not making s// find all matches (updated)
in thread /g option not making s// find all matches
if you're using /s and you want the "match anything except a newline" behavior, does not [^\n] best express this?In the context of /s, sure. But again, there is a larger context: someone else reading the regex will wonder at the incongruity of using /s at all in conjunction with a bunch of [^\n]s, when omitting the /s would simplify the whole thing (and also make the regex syntax match that used by most other regex engines, a consideration — albeit minor — when aiming for clarity).
One of the driving motivations of TheDamian's regex PBPs is clarity of expression.A goal we can all agree with! Now, enter devils and details.
Anyway, TheDamian explains it all more completely and clearly than I can, so maybe pursue that avenue.Point taken. I'm sure my perl experience is a tiny fraction of either yours or his.
|
---|