This is a demo test for the publishment of my bolg.
Code test:
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14 |
/*** 从一段文本中检索出唯一的结果* @param regx 正则表达式语句* @param text 要检索的文本* @return*/public
String regx(String regx,String text){Matcher matcher=Pattern.compile(regx).matcher(text);if(matcher.find())return
matcher.group();elsereturn
null;} |
/** * 从一段文本中检索出唯一的结果 * @param regx 正则表达式语句 * @param text 要检索的文本 * @return */ public String regx(String regx,String text) { Matcher matcher=Pattern.compile(regx).matcher(text); if(matcher.find()) return matcher.group(); else return null; }
picture test:
Blog publish demo,布布扣,bubuko.com
原文:http://www.cnblogs.com/miaomao/p/3600688.html