import java.util.regex.Pattern;
import java.util.regex.Matcher;
public class RegexTest{
public static void main(String [] args){
//指定字符串
String line = "this is a test" ;
//创建Pattern对象
String r = "(\\\\D*)(\\\\d+)(.*)";
Pattern p = Pattern.compile(r);
//创建Matcher对象
Matcher m = p.matcher(line);
//
if(m.find()){
System.out.println("find value:"+m.group(0));
System.out.println("find value:"+m.group(1));
System.out.println("find value:"+m.group(2));
System.out.println("find value:"+m.group(3));
}else{
System.out.println("no match");
}
}
}