Reputation: 341
I need to validate if the remaining characters after the 3rd character are numeric. The string after the 3rd character is 7 characters long.
I have the regex for the last remaining to be numeric
Regex:
([0-9]{7})
I need to add the other chunk that starts the validation at the 4th character.
An example of text to be validated would be something like this "PRA0987654". The 1st 3 characters are always alphabetic and they're either never the same. Another example could be "ACR0986745" So I can't just do:
R([0-9]{7})
or
A([0-9]{7})
Cause the 3rd character is never the same.
An incorrect validation would be something like this "ZZQA098345". It's incorrect cause the 4th character is alphabetic and not numeric.
Any help would be greatly appreciated.
Upvotes: 0
Views: 133
Reputation: 2396
You can try your regex with this excelent tool: http://rubular.com/
For your question, I think it could be
(.{3}\d{7}$)
Upvotes: 1