现在的位置: 首页 > 综合 > 正文

java正则使用

2018年12月10日 ⁄ 综合 ⁄ 共 138字 ⁄ 字号 评论关闭

Pattern p = Pattern.compile("\\d+");

 Matcher m = p.matcher("afa123");

boolean m.find() 任意位置匹配

boolean m.matches() 整个字符串匹配

boolean m.lookingAt() 字符串开头匹配


  

抱歉!评论已关闭.