“
String str = “北京市(朝阳区)(西城区)(海定区)”;
String ptr = “.*?(?=\()”;
Pattern p = Pattern.compile(ptr);
Matcher matcher = p.matcher(str);
if(matcher.find()){
System.out.println(matcher.group());
}
“`
北京市(朝阳区)(西城区)(海定区)正则表达式(代码保存)
最新推荐文章于 2019-06-17 11:52:00 发布