要想把类似“G11G12J1J2”这样的字符串拆分成G11、G12、J1、J2的样子,就是一个字母加一个数字。谢谢
------解决方案--------------------
- Java code
String str = "G11G12J1J2";//falseMatcher m=Pattern.compile("[a-zA-Z]+\\d+").matcher(str);while(m.find()){ System.out.println(m.group());}
String str = "G11G12J1J2";//falseMatcher m=Pattern.compile("[a-zA-Z]+\\d+").matcher(str);while(m.find()){ System.out.println(m.group());}