in reply to Re: The "anchor" misnomer in regexes
in thread The "anchor" misnomer in regexes
I’m not sure you have the semantics all correct: \z is always “end of string” and nothing else. \Z and $ are identical by default and mean “end of string, but before a newline if that’s the last character.” However, if you use the /m regex modifier, then $ (but not \Z) changes to line-based semantics and essentially says “before the next newline or at the end of the string (whichever is first).”
Just to straighten things for anyone for whom they were unclear.
(The clarification does, of course, not affect what you said about keeping state for $.)
Makeshifts last the longest.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: The "anchor" misnomer in regexes
by ysth (Canon) on Dec 26, 2005 at 06:13 UTC | |
by Aristotle (Chancellor) on Dec 26, 2005 at 06:30 UTC |