Re:Regex character "$" doesn't mean "end-of-string"
by samatman on Wednesday March 20, 2024 @10:29AM
(#39767104)
This does precisely nothing to solve the ambiguity issue when a final line lacks a newline. The representation of that newline isn't relevant to the problem.
[ Parent
| on HN ]
Re:Regex character "$" doesn't mean "end-of-string"
by Izkata on Wednesday March 20, 2024 @01:09PM
(#39769371)
It's actually slightly worse: Windows defines newline as a delimiter, not a terminator. So this:
foo\nbar\n
Would be 2 lines in *nix and 3 lines in windows.
Re:Regex character "$" doesn't mean "end-of-string"
by Gormo on Monday March 25, 2024 @08:45AM
(#39815623)
The point is that having a sequence of two delimiters to signal the end of the logical line allows you to have single instances of either delimiter included within the text. This allows visual line breaks to be included within the same line as understood by the regex parser.