Past the example coordinating accessible from LIKE provisos, MariaDB offers ordinary articulation based coordinating through the REGEXP administrator. The administrator performs design coordinating for a string articulation dependent on a given example.
MariaDB 10.0.5 presented PCRE Regular Expressions, which significantly expands the extent of coordinating into territories like recursive examples, look-ahead attestations, and that's only the tip of the iceberg.
Audit the utilization of standard REGEXP administrator language structure given beneath −
SELECT column FROM table_name WHERE column REGEXP '[PATTERN]';
REGEXP returns 1 for an example match or 0 without one.
A possibility for the contrary exists as NOT REGEXP. MariaDB likewise offers equivalent words for REGEXP and NOT REGEXP, RLIKE and NOT RLIKE, which were made for similarity reasons.
The example looked at can be an exacting string or something different, for example, a table segment. In strings, it utilizes C departure language structure, so twofold any "\" characters. REGEXP is likewise case-harsh, except for paired strings.
A table of potential examples, which can be utilized are given underneath −
|Sr.No||Pattern & Description|
It matches the start of the string.
It matches the string's end.
It matches a single character.
It matches any character in the brackets.
It matches any character not listed in the brackets.
It matches any of the patterns.
It matches 0 or more instances of the preceding element.
It matches 1 or more instances of the preceding element.
It matches n instances of the preceding element.
It matches m to n instances of the preceding element.
Survey the example coordinating models given beneath −
Items beginning with "pr" −
SELECT name FROM product_tbl WHERE name REGEXP '^pr';
Items finishing with "na" −
SELECT name FROM product_tbl WHERE name REGEXP 'na$';
Items beginning with a vowel −
SELECT name FROM product_tbl WHERE name REGEXP '^[aeiou]';