Category: Script
/ Strings
Since engine version: 8.0 OC
RegexSearch
Description
Performs a regular expression match, returning an array of match positions.
Syntax
array RegexSearch(string text, string regex, int flags);
Parameters
- text:
- String to search in.
- regex:
- Regular expression in ECMAScript syntax.
- flags:
- Bitmask of the following values:
Constant Description Regex_CaseInsensitive Regular expression is case insensitive. Regex_FirstOnly Stop after first match, returning an array with zero or one elements.
Example
Log("%v", RegexSearch("hello world", "l"));
Searches for the character l, returning [2, 3, 9].