Bootstrap

正则表达式匹配所有以小写字符开头的单词

//正则表达式
"(\\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
;