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
ACT 2009 on SBS 2008 system.io.pathtoolong exception error
Database Startup form while other form loads
Stripping characters in Select Statement
Why does InternetConnect function need a password and a login ?
Pop pop calender when clicking textbox in userform
Exchange 2010: 550 5.7.1 Client does not have permissions to send as this sender
Windows Server 2008 File Server inaccessible from clients
Can you Transfer CALS
Setup Exchange 2010 to Receive Mail
MS Access: sending table or reports (in Excel or text forms) via email