Bundle Regular expression matching and replacement. RegEx compiles a pattern once and supports full match, substring search, capture groups, and global replacement. Included in lang.obl.
Result
RegEx result
Operations
GetLength #
Gets the string length of the match
method : public : GetLength() ~ IntReturn
| Type | Description |
|---|---|
| Int | string length of the match |
Example
re := RegEx->New("\\w+");
r := re->FindFirst("hello world");
if(r <> Nil) {
Console->PrintLine(r->GetLength());
};GetStart #
Gets the starting index of match
method : public : GetStart() ~ IntReturn
| Type | Description |
|---|---|
| Int | starting index of match |
Example
re := RegEx->New("\\d+");
r := re->FindFirst("price: 99 dollars");
if(r <> Nil) {
Console->PrintLine(r->GetStart());
};