爱程序网

java正则表达式匹配字符

来源: 阅读:

假设要匹配${2}中间为数字的这个类型的变量String,则

Pattern p = Pattern.compile("\\$\\{\\d+\\}");
Matcher m = p.matcher(String);
boolean b = m.find();
while (b) {

  //后续操作……

}

关于爱程序网 - 联系我们 - 广告服务 - 友情链接 - 网站地图 - 版权声明 - 人才招聘 - 帮助