RLIKE is a MySQL and MariaDB comparison operator that performs pattern matching using regular expressions. It is functionally synonymous with the REGEXP operator. When evaluated, RLIKE converts both operands to strings and applies the database’s regex engine (based on Henry Spencer’s POSIX extended implementation). The expression yields 1 (true) if the pattern matches any part of the string and 0 (false) otherwise. Patterns are case-insensitive unless the collation or the REGEXP_LIKE() variant specifies otherwise. RLIKE works only in a WHERE, HAVING, ON, or SELECT context and cannot be used to write to data. Null in either operand returns NULL. Performance can degrade on large tables without indexes on deterministic predicates preceding RLIKE in the WHERE clause.
string_expression
(STRING) - The column or literal value to test.pattern_expression
(STRING) - The regular-expression pattern to match against the string.MySQL 3.23.4
LIKE matches simple wildcards (%) and (_) while RLIKE evaluates full regular expressions, enabling far more complex pattern checks.
It depends on collation. Case-insensitive collations such as utf8mb4_general_ci make RLIKE case-insensitive. Binary collations like utf8mb4_bin enforce case sensitivity.
Escape regex meta-characters with a backslash. Because SQL strings also treat backslash as an escape, provide two backslashes (\\) so one reaches the regex engine.
Yes when applied to large unindexed text columns. Combine it with other selective predicates or computed columns to minimize full table scans.