Match strings against regular expression patterns, enabling flexible search beyond simple LIKE wildcards.
Matches strings against regular expressions for complex pattern matching. Syntax and capabilities vary significantly across databases (POSIX in PostgreSQL, ICU in MySQL 8+, T-SQL in SQL Server). Performance can degrade on complex patterns over large text.
| Database System | Support Status | Since Version | Notes |
|---|---|---|---|
| MySQL | ✓ Supported | all | REGEXP and RLIKE operators for matching. REGEXP_LIKE(col, pattern [, flags]), REGEXP_SUBSTR(), REGEXP_REPLACE(), REGEXP_INSTR() added in 8.0. Uses ICU regex library (8.0+), POSIX before that. Case-insensitive by default. |
| PostgreSQL | ✓ Supported | all | Rich operator set: ~ (match, case-sensitive), ~* (match, case-insensitive), !~ (no match), !~* (no match, case-insensitive). SIMILAR TO for SQL-standard regex. regexp_match(), regexp_matches(), regexp_replace(), regexp_split_to_table() as functions. |
| SQL Server | ✗ Not Supported | — | No native regex support in T-SQL. LIKE with [] character class provides limited pattern matching. Full regex requires CLR integration (SQLCLR) or application-layer filtering. |
| Oracle | ✓ Supported | 10g | REGEXP_LIKE(col, pattern [, flags]) for WHERE clauses. Also REGEXP_SUBSTR(), REGEXP_INSTR(), REGEXP_REPLACE(), REGEXP_COUNT(). Uses POSIX Extended Regular Expressions. Case-sensitive by default; use 'i' flag for case-insensitive. |
| SQLite | ✗ Not Supported | — | The REGEXP operator exists in the syntax but has no built-in implementation — it requires a user-defined function to be registered at connection time. Most SQLite drivers (Python's sqlite3, etc.) do not register one by default. |
SQL Server is the major holdout — no native regex means workarounds are LIKE with limited [] syntax or moving regex logic to the application. PostgreSQL's operator-based approach (~ / ~* / !~ / !~*) is the most concise. SQLite's REGEXP is a syntax trap — it exists but silently fails unless a UDF is registered.
REGEXP and RLIKE operators for matching. REGEXP_LIKE(col, pattern [, flags]), REGEXP_SUBSTR(), REGEXP_REPLACE(), REGEXP_INSTR() added in 8.0. Uses ICU regex library (8.0+), POSIX before that. Case-insensitive by default.
Rich operator set: ~ (match, case-sensitive), ~* (match, case-insensitive), !~ (no match), !~* (no match, case-insensitive). SIMILAR TO for SQL-standard regex. regexp_match(), regexp_matches(), regexp_replace(), regexp_split_to_table() as functions.
No native regex support in T-SQL. LIKE with [] character class provides limited pattern matching. Full regex requires CLR integration (SQLCLR) or application-layer filtering.
REGEXP_LIKE(col, pattern [, flags]) for WHERE clauses. Also REGEXP_SUBSTR(), REGEXP_INSTR(), REGEXP_REPLACE(), REGEXP_COUNT(). Uses POSIX Extended Regular Expressions. Case-sensitive by default; use 'i' flag for case-insensitive.
The REGEXP operator exists in the syntax but has no built-in implementation — it requires a user-defined function to be registered at connection time. Most SQLite drivers (Python's sqlite3, etc.) do not register one by default.