Quote:
Originally Posted by 3lou 55
Yep cheers, that worked!
Thanks alot.
|
I found that some people use seperators more than once in a row so I had to make sure that the first and last character are not separators, and that there's never more than one separator in a row. Here's my way:
/^[A-Za-z0-9]+(?:[ _-][A-Za-z0-9]+)*$/
After matching one or more alphanumeric characters, if there's a separator it must be followed by one or more alphanumerics.