I'm trying to build a regex to meet the following requirement
4 digits / 6 digits / 3 digits
e.g. 4444/666666/333
But, the last slash and 3 digits are optional
Here is what i have so far:
/^\d{4}[/]\d{6}[/]{0,1}\d{0,3}$/
However, if i enter 4444/666666333 or 4444/666666/ that will also pass :(
Is it possible to put in a condition that will force a slash, if the remaining 3 digits are entered? Or, if the final slash is entered, the remaining 3 digits must also be entered too?
thanks Scott