
Regular-Expressions.Info is another good resource to learn about PCRE and regular expressions generally. The pages pcresyntax.html and pcrepattern.html should be a good start. For more details please refer to the documentation on the PCRE site, or to the documentation which is bundled in the /pcre/doc/html/ directory of a MariaDB sources distribution. This section briefly describes the most important extended PCRE features. MariaDB 10.0.11 introduced the default_regex_flags variable to address the remaining compatibilities between PCRE and the old regex library. In most cases PCRE is backward compatible with the old POSIX 1003.2 compliant regexp library (see Regular Expressions Overview), so you won't need to change your applications that use SQL queries with the REGEXP/RLIKE predicate. See the individual articles for more details and examples.
REGEXP_SUBSTR(subject,pattern) - Returns the matching part of a string. REGEXP_INSTR(subject, pattern) - Position of the first appearance of a regex. REGEXP_REPLACE(subject, pattern, replace) - Replaces all occurrences of a pattern. In earlier versions of MariaDB (and all MySQL versions) REGEXP/RLIKE works correctly only with 8-bit character sets. The switch to PCRE added a number of features, including recursive patterns, named capture, look-ahead and look-behind assertions, non-capturing groups, non-greedy quantifiers, Unicode character properties, extended syntax for characters and character classes, multi-line matching, and many other.Īdditionally, MariaDB 10.0.5 introduced three new functions that work with regular expressions: REGEXP_REPLACE(), REGEXP_INSTR() and REGEXP_SUBSTR().Īlso, REGEXP/RLIKE, and the new functions, now work correctly with all multi-byte character sets supported by MariaDB, including East-Asian character sets (big5, gb2313, gbk, eucjp, eucjpms, cp932, ujis, euckr), and Unicode character sets (utf8, utf8mb4, ucs2, utf16, utf16le, utf32). MariaDB 10.0.5 switched to the PCRE library, which significantly improved the power of the REGEXP/RLIKE operator. Defining Subpatterns For Use By Reference. Subroutine Reference and Recursive Patterns. Positive and Negative Look-Ahead and Look-Behind Assertions. Absolute and Relative Numeric Backreferences.
Special Category Properties For \p and \P.General Category Properties For \p and \P.