String regex = "(?<=\\[)(\\S+)(?=\\])";
Pattern pattern = Pattern.compile (regex);
Matcher matcher = pattern.matcher (destZoneCode);
while (matcher.find ())
{
System.out.println (matcher.group ());
}
java使用正则表达式提取方括号中内容
最新推荐文章于 2024-07-30 03:18:17 发布