How to find if there is a number in a string using regular expressions. (Java in General forum at Ja
String.matches() doesn't look for a substring to match the pattern, but checks whether the whole string matches the pattern. You will see that "6".matches("\\d") returns true but "x6".matches("\\d") returns false. You need to create a Patt...