标签:
教程:http://deerchao.net/tutorials/regex/regex-1.htm
在线调试:http://regexr.com/
import java.util.regex.Matcher; import java.util.regex.Pattern; public class TestPattern { public static void main(String args[]) { Pattern pattern = Pattern.compile("(\\w+)(\\d+)"); Matcher m=pattern.matcher("regexTest30-Mins"); while (m.find()) { System.out.println(m.group()); //regexTest123 System.out.println(m.group(0));//regexTest System.out.println(m.group(1));//30 } } }
标签:
原文地址:http://www.cnblogs.com/CUnote/p/5343065.html