码迷,mamicode.com
首页 > 其他好文 > 详细

【个人笔记】有关正则匹配的几点小笔记

时间:2016-03-29 12:48:52      阅读:114      评论:0      收藏:0      [点我收藏+]

标签:

匹配单个数字(不能>10): \d

匹配>10的数字: \d+

 

"1-WIFI-MAC_Match
2-WIFI-MAC_Match_Trust
3-WIFI-MAC_Mismatch
4-WIFI-MAC_History_NegativeList
5-WIFI-MAC_Missing“
"1-CERTNO_Match_Sharing_Bad
2-CERTNO_Match_Trust_Self_Sharing_Bad
3-CERTNO_Match_Sharing_Good
4-CERTNO_Match_Trust_Self_Sharing_Good
5-CERTNO_Match_Recency_Bad
6-CERTNO_Match_Trust_Self_Recency_Bad
7-CERTNO_Match_Recency_Good
8-CERTNO_Match_Trust_Self_Recency_Good
9-CERTNO_Match_Reliability_Bad
10-CERTNO_Match_Trust_Self_Reliability_Bad
11-CERTNO_Match_Reliability_Good
12-CERTNO_Match_Trust_Self_Reliability_Good
-1-获取失败"

匹配类似"1-IMSI_Match_Sharing_Bad","-1-获取失败":"(?:-1|\d+)(-[a-zA-Z\u4e00-\u9fa5_]+)+"

匹配第一部分数字: "(?:-1|\d+)"

匹配第二部分减号后面文字: "[-a-zA-Z\u4e00-\u9fa5_]+"

匹配"1-WIFI-MAC_Match": "(?m)^-?\d-(.*?)$"

技术分享

"\\d-[a-zA-Z_\u4e00-\u9fa5]+$" 这个只能匹配:   全匹配1-a  1-啥  1-_

 

几点基础:

技术分享

【个人笔记】有关正则匹配的几点小笔记

标签:

原文地址:http://www.cnblogs.com/x-poior/p/5332303.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!