正则表达式

匹配行或者字符串的起始位置

^                 

匹配行或字符串的结尾          $         
匹配单词边界 (boundary) \b 匹配不是单词开头或结束的位置 \B
匹配数字(digit) \d 匹配任意非数字的字符 \D
匹配字母、数字、下划线 (word) \w 匹配任意不是字母,数字,下划线的字符 \W
匹配空格 (space) \s 匹配任意不是空白符的字符 \S
 匹配除换行外的任何字符串  .    

 

 

 

 

 

 

 

 

在线匹配工具:http://rubular.com/

详细可以参考:https://www.cnblogs.com/lizhenlin/p/6654934.html

 

posted @ 2018-08-06 15:15  nnniki  阅读(120)  评论(0)    收藏  举报