Files
doris/docs/en/sql-reference/sql-functions/string-functions/regexp/regexp.md
EmmyMiao87 15c5896f41 [Docs] Add like, regexp function documents (#6182)
* [Docs] Add like, regexp function documents

* Reconstruct

* Fix compile error
2021-07-15 13:16:21 +08:00

1.4 KiB

title, language
title language
regexp en

regexp

description

syntax

'BOOLEAN regexp(VARCHAR str, VARCHAR pattern)'

Perform regular matching on the string str, return true if it matches, and return false if it doesn't match. pattern is a regular expression.

example

// Find all data starting with 'billie' in the k1 field
mysql> select k1 from test where k1 regexp '^billie';
+--------------------+
| k1                 |
+--------------------+
| billie eillish     |
+--------------------+

// Find all data ending with 'ok' in the k1 field:
mysql> select k1 from test where k1 regexp 'ok$';
+----------+
| k1       |
+----------+
| It's ok  |
+----------+

keyword

REGEXP