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

Variable name REGEX #9

Open
moravcik opened this issue Feb 2, 2018 · 1 comment
Open

Variable name REGEX #9

moravcik opened this issue Feb 2, 2018 · 1 comment

Comments

@moravcik
Copy link

moravcik commented Feb 2, 2018

There is a regex for variable name:

var REGEX = new RegExp('{{([a-zA-Z.-_0-9]+)}}', 'g');

I wonder why there is .-_ range included, as it is equal to charset range 46 to 95 (inclusive), which already contains all digits, all capital letters and special characters ./:;<=>?@[\]^_

I would need some other special characters in variable name, like | or , which are not included in the .-_ range. Are there any restrictions on variable name?

@ripla
Copy link

ripla commented May 21, 2018

Something like {{(.*?)}} worked better for me.

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

2 participants