in reply to Re^3: conditional regex
in thread conditional regex
I don't see any advantage in using /msx ...
A matter of personal taste. I find the rationale of PBP compelling with regard to 'standardizing' the behavior of the . ^ $ metacharacters, and always using 'extended' formatting for readability.
nor \A & \z ...
Another personal preference. When generating a regex like the one used in the example, I prefer to postpone consideration of certain questions (Must the pattern be at the start of the string? May there be whitespace before it?) to the point at which the regex is actually used. Specifically WRT \A \z I again accept the rationale of PBP for their use to anchor absolute start/end of a string (and they're almost imperative if /m is used).
[n]or qq{} ...
I use qq{} because I run my example code under Windoze shell and I'm trying to avoid irruptions of backwhacks. If no interpolation is involved, I'll typically use '' single-quotes.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: conditional regex
by BrowserUk (Patriarch) on Aug 23, 2010 at 05:13 UTC | |
by AnomalousMonk (Archbishop) on Aug 23, 2010 at 11:51 UTC |