• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 994
  • Last Modified:

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!
0
bsowards
Asked:
bsowards
  • 3
  • 3
1 Solution
 
MorcalavinCommented:
Have you tried this?
regEx.Pattern = "[^0-9a-z A-Z@._-,]"
0
 
bsowardsAuthor Commented:
Yes, it failed
0
 
MorcalavinCommented:
Try this:
regEx.Pattern = "[^0-9a-z A-Z@._-\,]"
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
bsowardsAuthor Commented:
Microsoft VBScript runtime  error '800a139d'

Invalid range in character set

/forms/contact_submit.asp, line 20
0
 
MorcalavinCommented:
Oh i see.  - is a special character.  escape it.
regEx.Pattern = "[^0-9a-z A-Z@._\-,]"
0
 
bsowardsAuthor Commented:
Thank You!
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now