Skip to content

Instantly share code, notes, and snippets.

@lanrion
Created March 7, 2016 08:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lanrion/7babeaf73fe899dd701a to your computer and use it in GitHub Desktop.
Save lanrion/7babeaf73fe899dd701a to your computer and use it in GitHub Desktop.
正则表达式
http://www.jb51.net/article/43190.htm
[...] 位于括号之内的任意字符
[^...] 不在括号之中的任意字符
. 除了换行符之外的任意字符,等价于[^\n]
\w 任何单字字符, 等价于[a-zA-Z0-9]
\W 任何非单字字符,等价于[^a-zA-Z0-9]
\s 任何空白符,等价于[\ t \ n \ r \ f \ v]
\S 任何非空白符,等价于[^\ t \ n \ r \ f \ v]
\d 任何数字,等价于[0-9]
\D 除了数字之外的任何字符,等价于[^0-9]
[\b] 一个退格直接量(特例)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment