提取字符串中的单词

String candidate = "this is a test, A TEST.";

String regex = "[a-zA-Z]+";

Pattern p = Pattern.compile(regex);

Matcher m = p.matcher(candidate);

posted @ 2022-04-10 20:15  启豪  阅读(77)  评论(0编辑  收藏  举报