Skip to main content

NOT_MATCH

Tom Williams avatar
Written by Tom Williams
Updated over a week ago

Type: Function

Function: NOT_MATCH

Syntax: NOT_MATCH(string, regex)

Description: Returns true if the first argument does not match the regular expression provided as second argument. The alternative shorthand version !~ is available.

The regex must be a POSIX regular expression. You can use this tool to test your regular 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:

  • NOT_MATCH(author_username, "^jo") OR author_username !~ "^jo" returns true when the author username does not start with "jo".

  • NOT_MATCH(url, "github.com") returns true when the URL does not contain "github.com", otherwise returns false.

  • NOT_MATCH("1234", "\\d+") returns false since the string contains numbers.

  • title !~ "(?c)fix" returns true when the title of the item does not contain "fix" at any place, with any letter casing. Otherwise returns false.


Regular Expression cheat sheet

  • "^fix" string starts with "fix"

  • "fix$" string ends with "fix"

  • "(?c)fix" string contains with "fix" (case-sensitive)

  • "fix|bug" string contains "fix" or "bug"

  • Test more regular expressions using this tool

Did this answer your question?