in reply to Re^3: $/ is playing havoc with my script.
in thread $/ is playing havoc with my script.
If you use /ms all the time, then \A always means "beginning of the string", ^ means "beginning of a line", \z means "end of the string", $ means "end of a line, . means "any character", and [^\n] means "any character but a newline".
You lose no functionality, and you gain the benefit of consistency (and possibly intuitiveness, depending on your intuition). You also partially eliminate what the Apocalypse calls the "end-weight problem", which I assume means that you have no idea what your regex is doing until you scan all the way to the end to see the modifiers. Whether this is really a problem is debatable, and you still have i and g (etc.) to grapple with in any case.
Of course you also lose a bit of conciseness, which is a minus. It's just a question of style. TMTOWTDI
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: $/ is playing havoc with my script.
by sauoq (Abbot) on Sep 26, 2005 at 15:43 UTC |