in reply to Re^3: The "anchor" misnomer in regexes
in thread The "anchor" misnomer in regexes
What are you proving? The \s+ part will start as far on the left as it can, and since your string is all newlines and you’re always using \s when you ask for character matches and have turned on /m, all character matches can match anywhere and the $ can match between any characters. So you’re not actually saying anything. No part of your pattern is constrained in any way, given the data you’re running it against.
I guess the bit I wrote about firstness does not actually say anything either, since “whichever is first” means “whichever is left-most” anyway and at any location between characters, only one of these conditions can be true. So $ in multiline mode matches before any newline or before the end of the string, and that’s that.
Makeshifts last the longest.
|
|---|