{"name":"regexMatch","operator":null,"title":"regexMatch","type":"command","url":"https://community.bistudio.com/wiki/regexMatch","revid":369126,"updated":"2024-09-03T10:34:33Z","groups":["Strings - Regular Expression"],"status":"ok","replaced_by":[],"games":[{"game":"arma3","name":"Arma 3","version":"2.06"}],"since":{"game":"arma3","name":"Arma 3","version":"2.06"},"arma3_since":"2.06","branch":null,"locality":{"argument":null,"effect":null,"server_exec":false},"exec":null,"description":"Returns whether the *haystack* matches the *pattern*.","syntaxes":[{"syntax":"haystack regexMatch pattern","since":null,"effect":null,"exec":null,"params":[{"name":"haystack","type":"String","optional":false,"default":null,"description":null,"types":["String"],"since":null,"text":"haystack: String"},{"name":"pattern","type":"String","optional":false,"default":null,"description":"in format regex pattern","types":["String"],"since":null,"text":"pattern: String - in format regex pattern"}],"returns":{"type":"Boolean","types":["Boolean"],"description":"returns true if match was found, otherwise false","text":"Boolean - returns true if match was found, otherwise false"},"form":"binary","operator":null,"left":{"text":"haystack","types":["String"]},"right":{"text":"pattern","types":["String"]}}],"examples":[{"text":"```sqf\n\"I'm a coOkIe clicker\" regexMatch \".*cookie.*\"; // true\n```","code":["\"I'm a coOkIe clicker\" regexMatch \".*cookie.*\"; // true"]},{"text":"```sqf\n\"I'm a coOkIe clicker\" regexMatch \".*cookie.*/\"; // false, empty flags == case sensitive\n```","code":["\"I'm a coOkIe clicker\" regexMatch \".*cookie.*/\"; // false, empty flags == case sensitive"]},{"text":"```sqf\nforceUnicode 1;\n\"I'm a coÖkIe clicker\" regexMatch \".*coökie.*\";\n```","code":["forceUnicode 1;\n\"I'm a coÖkIe clicker\" regexMatch \".*coökie.*\";"]},{"text":"```sqf\n\"Cookie clicker\" regexMatch \"cookie/i\"; // false, pattern does not fully match the haystack\n```","code":["\"Cookie clicker\" regexMatch \"cookie/i\"; // false, pattern does not fully match the haystack"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["regexFind","regexReplace"],"notes":[],"categories":["Arma 3: New Scripting Commands","Arma 3: Scripting Commands","Command Group: Strings - Regular Expression","Introduced with Arma 3 version 2.06","Scripting Commands"]}