import java.util.regex.*;
class L
{
public static void main(String args[])
{
checkTel();
}
public static void checkTel()
{
String str="ming tian jiu yao fang jia le.";
String reg="\\b[a-z]{3}\\b";
Pattern p=Pattern.compile(reg);
Matcher m=p.matcher(str);
while(m.find())
{
System.out.println(m.group());
}
}
}
正则表达式 获取
最新推荐文章于 2023-12-05 16:25:27 发布