Check and extract a number from a String in Java

try this

str.matches(".*\\d.*");

Leave a Comment