troubleshooting Question

URGENT: Regular Expressions

Avatar of dwe0608
dwe0608Flag for Australia asked on
Visual Basic Classic
4 Comments1 Solution223 ViewsLast Modified:
looking at the following function:

    Dim re As RegExp 'Declare a regular expression object
    Set re = New RegExp 'Instantiate it so we can work with it
    Dim retStr$
    With re
        .Pattern = "[*\""\/\\\?\<\>\|\:\..\'\]" 'set the pattern to match, any of * " \ / ? < > | : characters
        .Global = True ' Set to replace all instances of a match in the string
        RICFromString = .Replace(strIn, "-") ' perform the replace on the value of instr
    End With
    Set re = Nothing 'clean up by destroying the regexp object

I need to modify it to replace  all occurrences of of * " \ / ? < > | : (which it does) and also replaces .. (two dots) or '  (single quote)


Wayne Taylor (webtubbs)

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 4 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros