Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Escape "-", don't escape "}" #9

@twhb

Description

@twhb

"-": this is a control within character sets. Escaping content for use within character sets is already fully supported except for this character, including escaping "]", which doesn't need escaping except within character sets.

"}": this isn't a control anywhere except within quantifiers. Within a quantifier, escaping this results in an invalid regex. escape-string-regexp doesn't, and can't possibly, support escaping strings meant for a quantifier context.

If you approve of the change, I'll make a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions