Check and extract a number from a String in Java December 15, 2022 by Tarik try this str.matches(".*\\d.*");