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
Dynamic Crosstab report
VBA Function with Array Parameter not working
Omitting data based on record type
activex - Modify a textbox.value in a form on a webpage which also has the activex vb6
System.EnterpriseService Error
Total cost formula using Excel
Add reference to Microsoft.SqlServer.Manage<wbr />ment not available
Silverlight bandwidth performance
Convert Epoch Date from Mysql to MS Access
SSRS 2008 images after text