Skip to content

error for CJK variable name #50

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

Open
gallex opened this issue Apr 23, 2014 · 0 comments
Open

error for CJK variable name #50

gallex opened this issue Apr 23, 2014 · 0 comments

Comments

@gallex
Copy link

gallex commented Apr 23, 2014

When use CJK char as variable name in PHP, it would error. I found the reson is it use regular expression /^$[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/ to match variable , but JS string is unicode so the match would fail.

I suggest to use /^$[a-zA-Z_\u4E00-\u9FA5][a-zA-Z0-9_\u4E00-\u9FA5]*/ .

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