Regular Expressions in Visual Basic 4

Way back in 1998 (the days of Visual Basic 4) I found myself needing an integrated solution to pattern matching. Prior to this I had learned regular expressions from a brief stint in a multiplatform programming shop where the all work was done on Solaris workstations. Unfortunately not much was available to the VB4 programmer who wanted regular expression matching – especially if that matching was required to take place on executables targeted at 16 bit Windows for Workgroups (3.1) and on the newly minted 32 bit Windows95b.

Visual Basic 4 was the first version to support any type of objects. They weren’t real objects like C++ objects but they could act like objects. At least they had some degreee of polymorphism which was all I needed to get started. In early 1999 I completed PatterProRXE. Although it was not the fastest Regex Engine in the world it was very handy to have and it’s matching capability beat the builtin ‘Like’ operator hands down. It fully supported the regular expression syntax of the scanner generator ‘Lex’.

As a curiosity it is probably the only Regular Expression Engine to have been written in the Visual Basic 4, 5, 6 genre in the entire known world. The project also contains another interesting class that functions as a multi-state scanner/tokenizer. This was the foundation of a template based Scanner Generator for Visual Basic 5 known briefly as ‘ScanGen’.

You can find the code in the downloads section under PatternProRXE_VB6. Yes, I eventually ported the code to C# and there are older versions of this code on SourceForge.net.

~A

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

Leave a Reply