Skip to content

S05: backslash+<alpha> in regexes should never be literal. #115

Open
@pmichaud

Description

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.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions