正则匹配省市区

String regEx="[^省]+省[^市]+市+[^区]+区";  
Pattern p = Pattern.compile(regEx);   
Matcher m = p.matcher(city);
while(m.find()){
System.out.println(m.group());
}

你可能感兴趣的:(正则匹配省市区)