Re:Microsoft is updating Notepad
by nojvek on Friday July 13, 2018 @12:16AM
(#17520480)
\r?\n regex?
[ Parent
| on HN ]
No, you want \R, the generic Unicode linebreak sequence.
http://pcre.org/current/doc/html/pcre2pattern.html#newlinese...
Re:Microsoft is updating Notepad
by marcosdumay on Friday July 13, 2018 @01:23PM
(#17524868)
So, you take a `\r` from the network. So, do you wait for a `\n` before returning the line?
You wait to peek the next byte, or EOF, and then make the choice.
Re:Microsoft is updating Notepad
by marcosdumay on Saturday July 14, 2018 @12:23PM
(#17530930)
Line protocols do not transmit EOF (and the problem is on each line anyway). And the next byte may only come after you write something on the socket.