正则表达式匹配所有以小写字符开头的单词
发布时间:2020-12-14 04:22:55 所属栏目:百科 来源:网络整理
导读://正则表达式"(b[ a-z ][ A-Za-z ]*b)" 测试用例 Matcher mac = Pattern.compile("(b[ a-z ][ a-zA-Z ]*b)").matcher("the Aalone await abc wait success sdf"); while (mac.find()) { System.out.println(mac.group()); } 输出 看到将所有小写开头
//正则表达式
"(b[a-z][A-Za-z]*b)"
测试用例Matcher mac = Pattern.compile("(b[a-z][a-zA-Z]*b)").matcher("the Aalone await abc wait success sdf");
while (mac.find()) {
System.out.println(mac.group());
}
输出看到将所有小写开头的单词都输出来了 the
await
abc
wait
success
sdf
(编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |