public static void main(String[] args){
Scanner sc = new Scanner(System.in);
boolean flag = false;
System.out.println("请输入车牌号!");
do{
String carNumber = sc.next();
flag = carNumber.matches("(?i)^(CA|AZ|CO)[0-9]{4}$");
if(!flag){
System.out.println("车牌号不正确,请重新输入!");
}else{
System.out.println("车牌号正确!车牌号为:"+carNumber.toUpperCase());
}
}while(!flag);
}