I need regular expression for ID number, it's 9 numbers and the first number must be 4 or 9 or 8.
can some one help ?
I need regular expression for ID number, it's 9 numbers and the first number must be 4 or 9 or 8.
can some one help ?
You can use the following regex:
^[489][0-9]{8}$
String.matches() or Matcher.matches() you don't need them, but if you were doing Matcher.find() you would. That answer was deleted so I'm leaving it here as it's also relevant to this answer.