java怎么利用正則表達式?
String testString = "java怎么利用正則表達式從給定的字符串中取出匹配規則字符串";
Pattern pattern = Pattern.compile("\\w+");
Matcher matcher = pattern.matcher(testString);
while(matcher.find())
{
System.out.println(matcher.group());
}
java怎么利用正則表達式?
String testString = "java怎么利用正則表達式從給定的字符串中取出匹配規則字符串";
Pattern pattern = Pattern.compile("\\w+");
Matcher matcher = pattern.matcher(testString);
while(matcher.find())
{
System.out.println(matcher.group());
}