Add Comma to this RegEx

How do I add commas as an acceptable character to this RegEx definition set?

Dim regEx
Set regEx = New RegExp
regEx.Global = true
regEx.Pattern = "[^0-9a-z A-Z@._-]"

Thanks!
bsowardsAsked:
Who is Participating?
 
MorcalavinCommented:
Oh i see.  - is a special character.  escape it.
regEx.Pattern = "[^0-9a-z A-Z@._\-,]"
0
 
MorcalavinCommented:
Have you tried this?
regEx.Pattern = "[^0-9a-z A-Z@._-,]"
0
 
bsowardsAuthor Commented:
Yes, it failed
0
Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

 
MorcalavinCommented:
Try this:
regEx.Pattern = "[^0-9a-z A-Z@._-\,]"
0
 
bsowardsAuthor Commented:
Microsoft VBScript runtime  error '800a139d'

Invalid range in character set

/forms/contact_submit.asp, line 20
0
 
bsowardsAuthor Commented:
Thank You!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.