MORegularExpression


Represents a regular expression which can be matched against candidate strings.
Superclass: NSObject



MORegularExpression objects are initialized from a pattern string in something similar to unix-style regular expression syntax (such as used in egrep) and can be used to match other strings against the pattern. In addition to the pattern string you can specify whether the expression should be case-insensitive. They are immutable. If you need to match another pattern, make another MORegularExpression.

The implementation is almost entirely provided by Henry Spencer's Uniocode-based regular expression package which is used by the MOKit framework in a (slightly) modified form and was originally taken from TCL (8.3.2). The unmodified code can be found in the HSRegexp group/folder in the Readmes and Notes group of the MOKit_2 project. (Using FileMerge to compare the original HSRegexp folder with the modified MORegexp folder will show the exact changes made.)

MORegularExpression uses the Advanced Regular Expression (ARE) syntax. This is basically a further extension of POSIX Extended Regular Expression (ERE) syntax (basically, what egrep uses). Details on the syntax can be found in the document RESyntax.rtf included with the MOKit framework (Safari and OmniWeb will show this RTF document directly in the browser, other browsers may need to use a helper application).

In addition to simply matching candidate strings, MORegularExpressions can take advantage of the subexpressions defined within the regular expression and can return the matching ranges or substrings for any subexpression from a matching candidate string.



(Last Updated 3/20/2005)
HTML documentation generated by HeaderDoc