Regular Expressions in RBScript
February 14, 2002

Here’s a project that will let you create & use RegEx classes in your RBScripts.

How it works: In the project, there is an RBScript subclass called “RegExScript”. This class is a factory for creating, storing & accessing REALbasic’s RegEx & RegEx related objects.

Next, there is some accompanying RBScript code that defines “local” copies of REALbasic’s RegEx classes. These RBScript classes contain the code necessary to communicate back to the RegExScript object, passing requests for RegEx methods and returning the results.

Using RegEx in RBScript is similar to using the same classes in REALbasic: Just dimension, create and use. There are three caveats you should be aware of, however:

  1. Requires REALbasic 4.0.2 or greater.
  1. You must use setter methods to change the properties of any RBScript RegEx or RegEx related object. (See sample code)
  2. The RegEx objects which are created and stored in RegExScript objects are persistent until that RegExScript object is destroyed.

Have fun.

Warning! This project no longer works with current versions of REALbasic.

Download
RBScriptRegEx_1.0b3.sit (18.12Kb)