Match either of the sequences de or abc: de|abc : Sequence « Regular Expressions « MySQL Tutorial






mysql>
mysql> SELECT 'ABC' REGEXP 'ABC|DEF';
+------------------------+
| 'ABC' REGEXP 'ABC|DEF' |
+------------------------+
|                      1 |
+------------------------+
1 row in set (0.00 sec)

mysql>
mysql> SELECT 'ABC' REGEXP 'DEF|ABC';
+------------------------+
| 'ABC' REGEXP 'DEF|ABC' |
+------------------------+
|                      1 |
+------------------------+
1 row in set (0.00 sec)

mysql>
mysql>
mysql> SELECT 'ABC' REGEXP '^(ABC|DEF)$';
+----------------------------+
| 'ABC' REGEXP '^(ABC|DEF)$' |
+----------------------------+
|                          1 |
+----------------------------+
1 row in set (0.00 sec)

mysql>








24.11.Sequence
24.11.1.Match either of the sequences de or abc: de|abc
24.11.2.Get first name with either 'av' or 'am'
24.11.3.Match zero or more instances of the sequence abc: (abc)*
24.11.4.Get first name with zero for more instances of the sequence 'Ja'