learn-regex icon indicating copy to clipboard operation
learn-regex copied to clipboard

$ is problematic

Open Porges opened this issue 7 years ago • 0 comments

This is a pet of mine – in (almost all) regex engines, $ means "end of input possibly preceded by a newline", whereas \z means "end of input".

It would be worth stating the difference here, as using $ can lead to broken validation regexes (consider the harm of being able to inject newlines in places they aren't expected, or being able to put an additional character after length validation, for example).

Porges avatar Aug 10 '17 13:08 Porges