RegexMatch

Kategorie: Script / Strings
Ab Engineversion: 8.0 OC

Beschreibung

Performs a regular expression match, returning an array of arrays containing [full match, submatch 1, submatch 2, etc.].

Syntax

array RegexMatch(string text, string regex, int flags);

Parameter

text:
String to match.
regex:
Regular expression in ECMAScript syntax.
flags:
Bitmask of the following values:
Konstante Beschreibung
Regex_CaseInsensitive Regular expression is case insensitive.
Regex_FirstOnly Stop after first match, returning an array with zero or one elements.

Beispiel

Log("%v", RegexMatch("OC 8.0", "(\\w+)\\s(\\d+)\\.(\\d+)"));
Parses a version string, printing [["OC 8.0", "OC", "8", "0"]].
Siehe auch: RegexReplace, RegexSearch, RegexSplit
Luchs, 2016-09