Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a table of every escaped character and "why" #31

Closed
domenic opened this issue Jul 2, 2015 · 8 comments
Closed

Create a table of every escaped character and "why" #31

domenic opened this issue Jul 2, 2015 · 8 comments
Assignees

Comments

@domenic
Copy link
Member

domenic commented Jul 2, 2015

I've asked for this a couple times, but I think it's crucial to forward progress, especially as people debate additions to the current spec.

Here is a start:

char reason
^ new RegExp("^") => syntax error; new RegExp("^") => matches the string "^"
@benjamingr
Copy link
Collaborator

Will do

@benjamingr benjamingr self-assigned this Jul 2, 2015
benjamingr added a commit that referenced this issue Jul 3, 2015
@benjamingr
Copy link
Collaborator

@domenic done :)

@domenic
Copy link
Member Author

domenic commented Jul 5, 2015

Yay! Might want to give it a proofread, but overall very helpful.

@jbnicolai
Copy link

If I can weigh in, I think we've nailed the exact list over at https://github.com/sindresorhus/escape-string-regexp/blob/master/index.js#L3

@jbnicolai
Copy link

Nevermind, the two seem to already be a 1 on 1 match - so kudos to @benjamingr ;)

@bergus
Copy link
Contributor

bergus commented Jul 5, 2015

The entry for ? should mention the usage of the syntax character in groups, not only as a quantifier.

The WhiteSpace entry in the extended safe set is currently a copy of the / entry. It should rather link to #30, or at least use \n instead of /.

The escaping of hex characters in the beginning should be added as a table entry to "Safe with extra escape set", so that they don't extend decimal or unicode escape sequences (#29).

@benjamingr
Copy link
Collaborator

@bergus can you open a separate issue please? (Pull request would also be welcome)

@cscott
Copy link

cscott commented Jul 5, 2015

Agreed with @bergus.

I'd also like to see the "safe with extra escape set" section reference @bergus' rationale for this set.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants