首页 > 编程 > Java > 正文

Java正则find all

2019-11-10 17:58:35
字体:
来源:转载
供稿:网友

java没有提供python的find_all函数(用来找出所有的匹配),但是可以实现:

List<String> matchStrings = new ArrayList<String>();while(matcher.find()){ matchStrings.add(matcher.group());}for(String str: matchStrings){ System.out.PRintln(str);}
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表