Arma 3 Scripting

Command in Strings - Regular Expression

regexMatch

Also available as Markdown and JSON, or read the original wiki page.

Description

Returns whether the haystack matches the pattern.

Syntax

haystack regexMatch pattern

Parameters:

Returns: Boolean - returns true if match was found, otherwise false

Examples

Example 1

"I'm a coOkIe clicker" regexMatch ".*cookie.*"; // true

Example 2

"I'm a coOkIe clicker" regexMatch ".*cookie.*/"; // false, empty flags == case sensitive

Example 3

forceUnicode 1;
"I'm a coÖkIe clicker" regexMatch ".*coökie.*";

Example 4

"Cookie clicker" regexMatch "cookie/i"; // false, pattern does not fully match the haystack

See also

regexFind · regexReplace