But that's the point: you never use anything other than an /xms tail in your own code.I dunno, that seems unnecessarily rigid. A "best practice" should mean "do this unless there's a good reason to do otherwise," not "always blindly do this no matter what." All three of those options modify the regex behavior. What if you need the unmodified behavior?
I realize "need" might be too strong a word; with /x, for instance, you can always just escape any literal space characters your regex needs. But if there are several of them, and your regex is otherwise simple, all those escapes clutter the code more than just omitting the /x. And someone else encountering m/a\ b\ c/xms in your code will wonder what tricky thing you're trying to do by telling the regex engine to ignore whitespace and then escaping all your whitespace.
I'm not saying your system is wrong — I'm certain it serves you well — but I don't think I'm sold on it yet.In reply to Re^6: /g option not making s// find all matches (updated)
by raygun
in thread /g option not making s// find all matches
by raygun
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |