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
In 7afa4fe there was an addition to S05 that says:
"Backslash escapes for literal characters in ordinary strings are allowed in regexes (C<\a>, C<\x>, etc.)."
To me, this is very wrong and should be reverted. For one, \a and \x in regexes explicitly do NOT match the letters "a" and "x"!
One of the important design principles underlying S05 was that backslash+alpha would always be "meta" and never literal. Otherwise this becomes one of those special-case lists that programmers have to memorize. (Out of the 26 ASCII alphabetic characters, the only literals would be <[gijklmpquyz]>, as <[abcdefhnorstvwx]> are all meta.)
I agree that \b and \B should be illegal, as opposed to the "match/reject a backspace (u+0008)" meaning.
The text was updated successfully, but these errors were encountered:
I just want to make sure that backslash+letter doesn't end up being interpreted as a quoted literal, in the sense that \j in a regex should be an error and not a way to match "j".
I recognize now that perhaps what the commit meant was that "\a" and "\x" in regexes match the same escaped characters that they do in double-quoted strings, but I didn't read it that way at first.
If the specs are purely historical, I don't mind if they're not patched, and I'll start looking to docs.perl6.org in the future I guess.
In 7afa4fe there was an addition to S05 that says:
"Backslash escapes for literal characters in ordinary strings are allowed in regexes (C<\a>, C<\x>, etc.)."
To me, this is very wrong and should be reverted. For one,
\a
and\x
in regexes explicitly do NOT match the letters "a" and "x"!One of the important design principles underlying S05 was that backslash+alpha would always be "meta" and never literal. Otherwise this becomes one of those special-case lists that programmers have to memorize. (Out of the 26 ASCII alphabetic characters, the only literals would be <[gijklmpquyz]>, as <[abcdefhnorstvwx]> are all meta.)
I agree that \b and \B should be illegal, as opposed to the "match/reject a backspace (u+0008)" meaning.
The text was updated successfully, but these errors were encountered: