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
Out of Office assistant on an additional mailbox
Linking from excel to Access and then back to excel
How do I disable File Download Security warning dialog box when trying to download a file from Internet Explorer
SBS 2008 Can't connect to my RWW from outside my network
Togglelink
Expected user-defined type, not project
Excel copy from sheet1 to sheet2
excel macro find selected range to use within macro
WSUS 3.0 server motherboard
Do not spell check or grammar was skipped.