java用正则匹配中文中括号,和英文中括号

比眉伴天荒 2022-06-16 04:47 531阅读 0赞
  1. String regex = "(?<=\\[)(\\S+)(?=\\])|(?<=【)[^】]*";
  2. Pattern pattern = Pattern.compile(regex);
  3. Matcher matcher = pattern.matcher(sss.get(i));
  4. while (matcher.find()) {matcher.get(0)}

发表评论

表情:
评论列表 (有 0 条评论,531人围观)

还没有评论,来说两句吧...

相关阅读