Re:Regex character "$" doesn't mean "end-of-string"
by pjc50 on Wednesday March 20, 2024 @07:27AM
(#39765030)
> I bet if someday VS Code's Windows build ships with LF default on new installations, people won't even notice.
As with '/', they really ought to do this some day but won't.
Re:Regex character "$" doesn't mean "end-of-string"
by divingdragon on Wednesday March 20, 2024 @06:33AM
(#39764722)
> Even CMD.EXE batch files support LF.
I don't know if it is the case on Windows 11, but I have surely been bitten by CMD batch files using LF line endings. I don't remember the exact issue but it may have been the one bug affecting labels. [1]
[1]: https://www.dostips.com/forum/viewtopic.php?t=8988#p58888
Re:Regex character "$" doesn't mean "end-of-string"
by n_plus_1_acc on Wednesday March 20, 2024 @06:17AM
(#39764627)
I could never get visual studio (not code) to not use \r\n when editing a solution file via the gui
I bet if someday VS Code's Windows build ships with LF default on new installations, people won't even notice.
I mean, at some point it did matter what the OS did when you pressed the "Enter" button. But this isn't really the case much anymore. VS Code catches that keypress, and inserts whatever "files.eol" is set to. Sublime does the same. I didn't check, but I assume every other IDE has this setting.
Similarly, the HTML spec, which is pretty nuts, makes browsers normalize my enters to LF characters as I type into this textarea here (I can check by reading the `value` property in devtools), but when it's submitted, it converts every LF to a CRLF because that's how HTML forms were once specced back in the day. Again though, what my OS considers to be "the standard newline" is simply not considered at all. Even CMD.EXE batch files support LF.
I don't really type newlines all that much outside IDEs and browsers (incl electron apps) and places like MS Word, all of which disregard what the OS does and insert their own thing. Maybe the terminal? I don't even know. I doubt it's very consequential.
EDIT: PSA the same holds for backslashes! Do Not Use Backslashes. Don't use "OS specific directory separator constants". It's not 1998, just type "/" - it just works.