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

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -