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:
- Requires REALbasic 4.0.2 or greater.
- You must use setter methods to change the properties of any RBScript RegEx or RegEx related object. (See sample code)
- The RegEx objects which are created and stored in RegExScript objects are persistent until that RegExScript object is destroyed.
Warning! This project no longer works with current versions of REALbasic.