Hướng dẫn mysql 5.6 regex
12.8.2 Regular ExpressionsTable 12.14 Regular Expression Functions and Operators
A regular expression is a powerful way of specifying a pattern for a complex search. This section discusses the operators available for regular expression matching and illustrates, with examples, some of the special characters and constructs that can be used for regular expression operations. See also Section 3.3.4.7, “Pattern Matching”. MySQL uses Henry Spencer's implementation of regular expressions, which is aimed at conformance with POSIX 1003.2. MySQL uses the extended version to support regular expression pattern-matching operations in SQL statements. This section does not contain all the details that can be found in Henry Spencer's
Regular Expression Function and Operator Descriptions
Regular Expression Syntax A regular expression describes a set of strings. The simplest regular expression is one that has no special characters in it. For example, the regular expression Nontrivial
regular expressions use certain special constructs so that they can match more than one string. For example, the regular expression As a more complex example, the regular expression A regular expression for the
To use a literal instance of a special character in a regular expression, precede it by two
backslash (\) characters. The MySQL parser interprets one of the backslashes, and the regular expression library interprets the other. For example, to match the string |