Could you please help me to provide a RegEx pattern to validate a string which satisfy:
- length from 4 to 10 (strictly)
- first 3 characters must be string (A-Z a-z)
- the remain characters must be number without
00
as prefix, I mean ABC15
is passed but ABC0015
is not.
This problem took me so much time and I have tried so many regex patterns, but I still have no solution for it.
Thank you so much.
Rob W :
Use this one:\n\n/^[a-z]{3}(?!00)\\d{1,7}$/i\n\n\nExplanation:\n\n/\n^ Start\n[a-z]{3} Three letters.\n(?!00) Must NOT be followed by two zeros.\n\\d{1,7} One to seven digits.\n$ End.\n/i ignore case flag.\n",
2012-02-19T18:19:45