Jump to content

preg_match with specified lenth question


fubowl

Recommended Posts

I think you can strip some stuff from your regex

/^[0-9]{4}$/

i is not needed, numbers are not case sensitive.

the * is not needed (maybe even confusing)

more cases can be found by preg_match_all

 

this regex doesn't allow any other characters than 0-9 but i assume you want that.

Does this help you? ::)

 

IF you want a certain range like starting from 1900 let me know

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.