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

Slash escaping in attribute regex throws SyntaxError #49

Open
yrtimiD opened this issue Feb 6, 2020 · 2 comments
Open

Slash escaping in attribute regex throws SyntaxError #49

yrtimiD opened this issue Feb 6, 2020 · 2 comments

Comments

@yrtimiD
Copy link

yrtimiD commented Feb 6, 2020

Trying to use a query: StringLiteral[text=/\/aaa/]
to find a line like: var s = "/aaa";
Fails with: "SyntaxError: Invalid regular expression: //: \ at end of pattern"

@andyrooger
Copy link

I'm having the same issue. Looks like \x2F works as a workaround instead, just remember to escape it for the string it's in.

@phenomnomnominal
Copy link
Owner

Unfortunately this one looks like it's an issue in the query parser which comes from esquery, as I can reproduce it here: http://estools.github.io/esquery/

They have an issue here and are looking for PRs: estools/esquery#68

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

3 participants