Syntax\n------\n\nexpr REGEXP pat, expr RLIKE pat\n\nDescription\n-----------\n\nPerforms a pattern match of a string expression expr against a patternpat. The pattern can be an extended regular expression. See Regular Expressions Overview for details on the syntax for\\\nregular expressions (see also PCRE Regular Expressions).\n\nReturns 1 if expr matches pat or 0 if it doesn't match. If either expr or pat are NULL, the result is NULL.\n\nThe negative form NOT REGEXP also exists, as an alias for NOT (string REGEXP pattern). RLIKE and NOT RLIKE are synonyms for REGEXP and NOT REGEXP, originally provided for mSQL compatibility.\n\nThe pattern need not be a literal string. For example, it can be specified as a string expression or table column.\n\nNote: Because MariaDB uses the C escape syntax in strings (for example, "\\n" to represent the newline character), you must double any "" that you use in your REGEXP strings.\n\nREGEXP is not case sensitive, except when used with binary strings.\n\nThe default_regex_flags variable addresses the remaining compatibilities between PCRE and the old regex library.\n\nExamples\n--------\n\nSELECT 'Monty!' REGEXP 'm%y%%';\n+-------------------------+\n| 'Monty!' REGEXP 'm%y%%' |\n+-------------------------+\n|                       0 |\n+-------------------------+\n\nSELECT 'Monty!' REGEXP '.';\n+----------------------+\n| 'Monty!' REGEXP '.' |\n+----------------------+\n|                    1 |\n+----------------------+\n\nSELECT 'new\\nline' REGEXP 'new\\\\.\\\\line';\n+---------------------------------------+\n| 'new\\nline' REGEXP 'new\\\\.\\\\line' |\n+---------------------------------------+\n|                                     1 |\n+---------------------------------------+\n\nSELECT 'a' REGEXP 'A', 'a' REGEXP BINARY 'A';\n+----------------+-----------------------+\n| 'a' REGEXP 'A' | 'a' REGEXP BINARY 'A' |\n+----------------+-----------------------+\n|              1 |                     0 |\n+----------------+-----------------------+\n\nSELECT 'a' REGEXP '^[a-d]';\n+---------------------+\n| 'a' REGEXP '^[a-d]' |\n+---------------------+\n|                   1 |\n+---------------------+\n\nURL: https://mariadb.com/docs/server/reference/sql-functions/string-functions/regular-expressions-functions/regexp