View Single Post
Old 01-22-2010, 06:38 PM  
Cyber Fucker
Hmm
 
Cyber Fucker's Avatar
 
Industry Role:
Join Date: Sep 2005
Location: On an endless road around the world for rock and roll.
Posts: 12,642
Quote:
Originally Posted by borked View Post
If the minus sign isn't a metacharacter, then what is it doing in eg A-Z and a-z and 0-9???

Of course it needs escaping

^[A-Za-z0-9\.\-_ ]{3,32}$

or shorter still
^[\w\.\-]{3,32}$
note with this though, \w as it's recognising word characters, will allow tabs and line breaks, not just white space.... if you don't want them, negate them:
^[\w\.\-^\t^\n]{3,32}$
Thank you! You restore my faith in webmater occurrence on this board.
__________________
Cyber Fucker is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote