Regex string: specific requirement -


i trying regex string right don't seem working should.

i have numeric field should have 5 digits. digits can start 04xxx , 5xxxx

this string not covering completly:

/[05][0-9][0-9][0-9][0-9]/ 

it forces start 0 or 5 followed 4 digits, allows example 012345

any ideas?

try regex pattern:

^(04|5\d)\d{3}$ 

Comments

Popular posts from this blog

java - HTTP Status 500 - An exception occurred processing JSP page /second.jsp at line 15 -

php - Using str_replace to translate a MySQL Table in html -

asp.net mvc - Cannot display error message on Editor or EditorFor -