Type: Function
Function: MATCH
Syntax: MATCH(string, regex) or alternatively, the shorthand version string ~ regex
Description: Returns true if the first argument matches the regular expression provided as the second argument. Also available as ~.
Matching is case-insensitive by default. You can make the regex case sensitive by adding (?c) at the beginning of your regex.
The regex must be a POSIX regular expression. You can use this tool to test regular your expressions
Note that backslashes (\) need to be escaped in strings. So typical regex patterns such as \d will have to be written \\d in regex strings. See the examples below.
Sample usage:
MATCH(author_username, "^jo")=author_username ~ "^jo"returnstruewhen the author username starts with "jo".MATCH(url, "github.com")returnstruewhen the URL contains "github.com", otherwise returnsfalse.MATCH("1234", "\\d+")returnstruesince the string contains numbers.title ~ "(?c)fix"returnstruewhen the title of the item contains "fix" at any place in a case sensitive manner. Otherwise returnsfalse.
βRegular Expression cheat sheet.:
"^fix"string starts with "fix""fix$"string ends with "fix""(?c)fix"string contains "fix" (case-sensitive)"fix|bug"string contains "fix" or "bug"Test more regular expressions using this tool
