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

/\.js$/ does not work #842

Closed
gorhill opened this issue Oct 19, 2015 · 5 comments
Closed

/\.js$/ does not work #842

gorhill opened this issue Oct 19, 2015 · 5 comments
Labels

Comments

@gorhill
Copy link
Owner

gorhill commented Oct 19, 2015

As reported in AMO's feedback section:

When using regexes it seems the $ option symbol interferes with the regexes. For example /.js$/ does not work until I remove the $ but then I can't match the end of the string. Is this a bug, and any workaround?

@RoxKilly
Copy link

Would this work? (a hack, not a fix)
/\.js.{0}$/

@gorhill
Copy link
Owner Author

gorhill commented Oct 26, 2015

No. The parsing code just naively lookup the first $ encountered, this is what I need to fix.

@gwarser
Copy link
Contributor

gwarser commented Oct 26, 2015

This works:
/\.js\u0024/$document

@gorhill
Copy link
Owner Author

gorhill commented Oct 26, 2015

@gwarser the $ is used as a special regex char in OP, not as a literal char.

@gwarser
Copy link
Contributor

gwarser commented Oct 26, 2015

Ahhh yes. I tested too quickly.

About this bug, I've seen this earlier uBlock-LLC/uBlock#1317 (comment)

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

No branches or pull requests

3 participants