Regex in VB6?

I need to write a program that can be sifted through specially formatted text files (mainly CSV files with a fixed set of column types that have different delimiters for some columns ... a comma in most places, a colon in others) to search for formatting errors. I believe that regular expressions will be a way.

Question: is there a good regex library for VB6?

Thanks!

Edit: Holy crap, 3 responses in less than an hour. Thank you, tone, people! I heard such good things about Regex Buddy from Jeff posts / podcasts that I have to take a look.

+7
regex vb6
source share
4 answers

Use the Regex COM component built into Windows. You can find the link step by step and use it in your project at: http://www.regular-expressions.info/vb.html

+4
source share

Regex Buddy has a VB6 library

I use it in Delphi, and it is very good - and Jeff raved about RegexBuddy several times.

I can’t talk about VB implementation, but it is definitely worth a look.

+2
source share

As you probably know, VB6 did not ship with a built-in regular expression library. However, you can use one of them provided by the ActiveX or COM library. See this article for more details .

+2
source share

Other answers are correct, but only links, so for convenience:

In the file β†’ Links, add the Microsoft VBScript Regular Expressions 5.5 library:

screenshot

Now you can use the library in your code:

Dim matcher As RegExp Set matcher = New RegExp matcher.Pattern = "^super cool string$" If matcher.Test(someString) Then '...do something... End If 

As usual, regular-expressions.info provides the best reference material .

+1
source share

All Articles