Reputation: 570
I need to validate following string using Regular Expressions. These are the constraints which apply for this string.
Ex: 84256142V, 547812375X
Can anyone provide me RegEx for validate this.
Upvotes: 1
Views: 131
Reputation: 13442
Depends on the language, but it will be something like this:
^[0-9]{9}[VvXx]$
Upvotes: 2
Reputation: 129894
^\d{9}[VX]$
if you put the regex engine in case-insensitive mode, ^\d{9}[vVxX]$
otherwise.
Upvotes: 5