Jin Kwon Jin Kwon - 1 month ago 6
Java Question

How can I match an input of not entirely digits?

What is the proper expression for checking that any input contains at least one non-digit char?

"11111111" doesn't match!
"1111111a" match!
"1111 111" match!


You can use the following regex where \D used for match any non-digit([^0-9]) character.


Regex explanation here

Regular expression visualization