Difference between revisions of "regexMatch"
Jump to navigation
Jump to search
m (Text replacement - "|gr1= regex" to "|gr1= Regular Expression (Regex)") |
Lou Montana (talk | contribs) m (Some wiki formatting) |
||
(11 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
{{RV|type=command | {{RV|type=command | ||
− | |game1= | + | |game1= arma3 |
+ | |version1= 2.06 | ||
− | | | + | |descr= Returns whether the ''haystack'' matches the ''pattern''. |
− | | | + | |gr1= Strings - Regular Expression |
− | | | + | |s1= haystack [[regexMatch]] pattern |
− | | | + | |p1= haystack: [[String]] |
− | | | + | |p2= pattern: [[String]] - in format [[Arma 3: Regular Expressions|regex pattern]] |
+ | |||
+ | |r1= [[Boolean]] - Returns [[true]] if match was found, otherwise [[false]] | ||
− | | | + | |x1= <sqf>"I'm a coOkIe clicker" regexMatch ".*cookie.*"; // true</sqf> |
− | | | + | |x2= <sqf>"I'm a coOkIe clicker" regexMatch ".*cookie.*/"; // false, empty flags == case sensitive</sqf> |
− | | | + | |x3= <sqf>forceUnicode 1; |
+ | "I'm a coÖkIe clicker" regexMatch ".*coökie.*";</sqf> | ||
− | | | + | |x4= <sqf>"Cookie clicker" regexMatch "cookie/i"; // false, pattern does not fully match the haystack</sqf> |
− | " | ||
|seealso= [[regexFind]] [[regexReplace]] | |seealso= [[regexFind]] [[regexReplace]] | ||
}} | }} |
Latest revision as of 19:28, 5 May 2022
Description
- Description:
- Returns whether the haystack matches the pattern.
- Groups:
- Strings - Regular Expression
Syntax
- Syntax:
- haystack regexMatch pattern
- Parameters:
- haystack: String
- pattern: String - in format regex pattern
- Return Value:
- Boolean - Returns true if match was found, otherwise false
Examples
- Example 1:
- Example 2:
- Example 3:
- Example 4:
Additional Information
- See also:
- regexFind regexReplace
Notes
-
Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note