Skip to content

error for CJK variable name #50

@gallex

Description

@gallex

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]*/ .

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions