Skip to content

Instantly share code, notes, and snippets.

@lirongfei123
Created February 11, 2019 11:41
Show Gist options
  • Save lirongfei123/b812faf6dedf689d13eba85b7d6c2a73 to your computer and use it in GitHub Desktop.
Save lirongfei123/b812faf6dedf689d13eba85b7d6c2a73 to your computer and use it in GitHub Desktop.
正则.md #正则
\w匹配的仅仅是中文,数字,字母,对于国人来讲,仅匹配中文时常会用到,见下
代码如下:
匹配中文字符的正则表达式: [\u4e00-\u9fa5]
或许你也需要匹配双字节字符,中文也是双字节的字符
代码如下:
匹配双字节字符(包括汉字在内):[^\x00-\xff]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment