北京市(朝陽區)(西城區)(海定區)正則表達式(代碼保存)

「 String str = 「北京市(朝陽區)(西城區)(海定區)」; String ptr = 「.*?(?=\()」; Pattern p = Pattern.compile(ptr); Matcher matcher = p.matcher(str); if(matcher.find()){ System.out.println(matcher.group()); } 「`web
相關文章
相關標籤/搜索