String a = "start = 12";
String regex = "\\D+";
System.out.println(a.replaceAll(regex, ""));

 \d 表示[0-9],匹配数字

\D表示[^0-9],匹配非数字,将非数字的内容替换为空可得到数字