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

Ensure regex starts with "/" and ends with "/" #10

Open
aik099 opened this issue Mar 11, 2016 · 0 comments
Open

Ensure regex starts with "/" and ends with "/" #10

aik099 opened this issue Mar 11, 2016 · 0 comments

Comments

@aik099
Copy link
Contributor

aik099 commented Mar 11, 2016

The code, that transforms regex rule into a JavaScript assumes it starts with / and ends with /. In PHP however there are no such restriction. This way if somebody adds new regex rule using different delimiters it would result in JavaScript error.

I see following options:

  • either enforce specific delimiter usage (the / specifically) - easier to do, but eposes fact, that JavaScript is generated inernally
  • or replace used delimiter with / when converting to JavaScript - better, but would require escaping new delimiter inside regex as well
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

1 participant