标签:
/**
*从一段文本中检索出唯一的结果
*@param regex 正则表达式语句
*@param text 要检索的文本
*@return
*/
public String regx(String regx, String text)
{
Matcher matcher = Pattern.compile(regx).matchter(text);
if(matcher.find())
rerturn matcher.group();
else
return null;
}标签:
原文地址:http://www.cnblogs.com/jangfei/p/4915382.html