Arma 3 Scripting

Description

Searches in a string with a regular expression.

Note

See Arma 3: Regular Expressions.

Syntax

haystack regexFind [pattern, startOffset]

Parameters:

Returns: Array of nested arrays. Each lowest level array in format:

Examples

Example 1

"wooKie boOkie cookie" regexFind [".ookie/gio"]; // [[["wooKie", 0]], [["boOkie", 7]], [["cookie", 14]]]

Example 2

"wooKie boOkie cookie" regexFind [".ookie/i"]; // [[["wooKie",0]]]

Example 3

"wooKie boOkie cookie" regexFind [".ookie/"]; // [[["cookie", 14]]]

Example 4

Multiline example:

"co1kie2
co2kie" regexFind ["^co.kie$"]; // [[["co2kie",9]]]

Example 5

"I'm a cookie clicker" regexFind ["c(.*?)k(.*?)e/i"]; // [[["cookie",6], ["oo", 7], ["i", 10]]]

Example 6

"I'm a cookie clicker" regexFind ["c(.*?)k(.*?)e"]; // [[["cookie", 6], ["oo", 7], ["i", 10]], [["clicke", 13], ["lic", 14], ["", 18]]]

See also

regexMatch · regexReplace