Microsoft
Software
Hardware
Network
Question : Need to allow a hyphens ("-") for user names in text field
I have this for a Regular Expression for a user name text field: [0-9a-zA-Z]{6,20}
However, found out that users wanted to add a hyphen or "-" to user names. How can I adjust my regular expression [0-9a-zA-Z]{6,20} to allow the hyphens or "-"?
Answer : Need to allow a hyphens ("-") for user names in text field
You would need to escape the hyphen with a backslash within the character set brackets:
[0-9a-zA-Z\-]{6,20}
Random Solutions
Control lock Question
Exchange 2010 Uninstall
¿Why is Access 2007 not respecting the Windows Date format setting?
Why does GetModuleFileName return long names sometimes, and mangled names sometimes (WinNT)?
How to supress 'Access denied' when copy/replace file in the System folder using Command Prompt
connection has timed out ... iis setting?
AD Login Script not working on Windows 7 - but will run locally from same computer
Call NetMessageBufferSend function from vb.net
Server 2003 RDP connection fails.
IE8 home page is being forced to google.co.uk