-
-
Save lirongfei123/b812faf6dedf689d13eba85b7d6c2a73 to your computer and use it in GitHub Desktop.
正则.md #正则
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\w匹配的仅仅是中文,数字,字母,对于国人来讲,仅匹配中文时常会用到,见下 | |
代码如下: | |
匹配中文字符的正则表达式: [\u4e00-\u9fa5] | |
或许你也需要匹配双字节字符,中文也是双字节的字符 | |
代码如下: | |
匹配双字节字符(包括汉字在内):[^\x00-\xff] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment