Chapter 11. Regular Expression Methods from RegexSupport.g

Table of Contents
Compile — compiles a regular expression to a form that is more efficient to evaluate.
CompileSubst — compiles a substitution pattern.
CompileSubstEx — an alternate interface to CompileSubst.
Config — queries the PCRE library for compiled-in options.
Exec — applies a regular expression match to a subject string.
pcrs_job.Exec — applies a compiled pattern substitution to a subject string.
GetStringNumber — retrieves the index number of named substrings.
Match — a convenience function that combines calls to Compile, Study, and Exec.
Study — helpful for speeding up repeated applications of a regular expression.
Subst — applies a substitution pattern to a string of a given length.

The RegexSupport.g file provides support for the Perl-Compatible Regular Expression (PCRE) library (http://www.pcre.org/) and includes the PCRS substitution extensions to PCRE.

[Important]

You must require the Regex support methods before you can use them in a script. At the top of your script, include the following line:

require (RegexSupport);

The RegexSupport.g file is located in the require folder of your DataHub installation.

The RegexSupport.g file provides three classes:

[Note]

Please see the Match and Subst entries for examples.