import java.util.regex.Pattern;
import java.util.Arrays;
import java.util.regex.Matcher;
public class 拆分
{
public static void main(String[] args)
{
String str="A1B2C3D4E5F6G7H8";
int[]shu=new int[8];
int i=0;
String[] s1=new String[8];
Matcher m=Pattern.compile("\\d").matcher(str);
while(m.find())
{
shu[i++]= Integer.parseInt(m.group());
}
System.out.print(Arrays.toString(shu));
System.out.print("\n");
Matcher n=Pattern.compile("\\D").matcher(str);//正则
i=0;
while(n.find())
{
s1[i++]= n.group();
}
System.out.print(Arrays.toString(s1)); //输出数组
}
}