You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Personally, I like the current magical handling of treating \n and \r in the subject text as literal LF and CR characters when searching for matches. However, it's non-obvious and only works for these two tokens (and not others supported by JS string literals like \\, \t, \v, \f, \b, \xFF, etc.). Therefore, most people are likely to initially expect that the regex \\n should match \n in the subject text (it doesn't).
(Aside: because of the current handling, there is no way to make a regex of \\n match anything. It won't match \n or \\n because \\ is not given the same magic handling in the subject text and therefore, for subject text \\n, the string is considered to be \ followed by a literal LF.)
Proposal: Apply special styling to \n and \r wherever they appear in the subject text, or alternatively, automatically convert them to the characters ␊ (U+240A) and ␍ (U+240D) as soon as they're typed in the subject text, then apply the magical match handling to ␊ and ␍.
The text was updated successfully, but these errors were encountered:
Personally, I like the current magical handling of treating
\n
and\r
in the subject text as literal LF and CR characters when searching for matches. However, it's non-obvious and only works for these two tokens (and not others supported by JS string literals like\\
,\t
,\v
,\f
,\b
,\xFF
, etc.). Therefore, most people are likely to initially expect that the regex\\n
should match\n
in the subject text (it doesn't).(Aside: because of the current handling, there is no way to make a regex of
\\n
match anything. It won't match\n
or\\n
because\\
is not given the same magic handling in the subject text and therefore, for subject text\\n
, the string is considered to be\
followed by a literal LF.)Proposal: Apply special styling to
\n
and\r
wherever they appear in the subject text, or alternatively, automatically convert them to the characters␊
(U+240A) and␍
(U+240D) as soon as they're typed in the subject text, then apply the magical match handling to␊
and␍
.The text was updated successfully, but these errors were encountered: