public static String number(String name){
name = name.replaceAll("[^(0-9)]", "");
return name;
name = name.replaceAll("[^(0-9)]", "");
return name;
}
public static void main(String[] args) {
String name1="";
String name2="";
String a = "浙江YD10M流量直充";
//Pattern pattern = Pattern.compile("(\\d*兆)|(\\d*M)");
//Pattern pattern = Pattern.compile("(\\d*元)");
Pattern pattern = Pattern.compile("(\\d*兆)|(\\d*M)");
Matcher matcher = pattern.matcher(a);
while (matcher.find()) {
name1=matcher.group(0);
name2 = number(name1);
System.out.println("---"+name2);
}
}