简体   繁体   English

如何将这些ASCI代码转换为Unicode?

[英]How can I convert these ASCI codes to Unicode?

jslint appears to complain here: jslint似乎在这里抱怨:

Unexpected '\' before 'X'.
    Priv.SELECTOR = /^(@|#|\.)([\x20-\x7e]+)$/;

Perhaps if I used Unicode things would work? 也许如果我使用Unicode,事情会起作用吗?

It seems that \\uXXXX notation is recognized by jslint as valid. 似乎jslint将\\uXXXX表示法识别为有效。 Use 采用

Priv.SELECTOR = /^([@#.])([\u0020-\u007e]+)$/;

or 要么

Priv.SELECTOR = new RegExp("^([@#.])([\\u0020-\\u007e]+)$");

Note that the backslashes must be doubled inside a RegExp constructor. 注意,反斜杠必须在RegExp构造函数中加倍。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM