java remove non numbers from string

Java
String str = "a12.334tyz.78x";
str = str.replaceAll("[^\\d.]", "");
Source

Also in Java: