Skip to content

Class: cRegEx

Include: Use System\Regex.pkg

Hierarchy: External_Class cRegEx using "regex"

Package: System\Regex.pkg

cRegEx stores an expression and option properties, then runs match, split, and substitute operations against strings.

Properties

See Properties.

Name Purpose
pbAnchored Anchors matching behavior.
pbGreedy Controls greedy matching.
pbIgnoreCase Enables case-insensitive matching.
pbIgnorePatternWhitespace Ignores pattern whitespace.
pbMultiline Enables multiline matching behavior.
pbUnicodeProperties Enables Unicode property matching.
psExpression Regular expression pattern.

Methods

See Methods.

Name Purpose
Match Returns whether the expression matches the input.
MatchAll Returns all matched strings.
MatchAllCallback Invokes a callback for matches.
MatchAllGroups Returns matched capture groups.
MatchAllOffsets Returns match offsets.
RMatch Matches from the right.
Split Splits input around matches.
Substitute Replaces the first match.
SubstituteAll Replaces every match.
SubstituteExCallback Builds replacements through a callback.

Example

Handle hoRegex
String sResult
Get Create (RefClass(cRegEx)) to hoRegex
Set psExpression of hoRegex to "cat"
Get SubstituteAll of hoRegex "cat dog cat" "fox" to sResult
Send Destroy of hoRegex

See also