Jump to content

[SOLVED] can I combine these two regexs into one?


solarisuser

Recommended Posts

Hi All,

 

Is it possible to combine these two regexs I use?  I'm not well versed in regex....

 

First One:    /^[a-zA-Z0-9 -]+$/

Second One:  /^.{3,21}$/

 

Essentially, allow "a-zA-z0-9, spaces, and dashes", and it must be between 3 and 21 characters in length.

 

 

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.