Regex for 5 digit number with optional characters
I am trying to create a regex to validate a field where the user can enter
a 5 digit number with the option of adding a / followed by 3 letters. I
have tried quite a few variations of the following code:
^(\d{5})+?([/]+[A-Z]{1,3})?
But I just can't seem to get what I want.
For instance l would like the user to either enter a 5 digit number such
as 12345 with the option of adding a forward slash followed by any 3
letters such as 12345/WFE.
No comments:
Post a Comment