find numbers in a string java

Java
String str = "qwerty1qwerty2";      
str = str.replaceAll("[^0-9]+", " ");
System.out.println(Arrays.asList(str.trim().split(" ")));
Source

Also in Java: