24. 6. 1. [:character_class:] represents a character class that matches all characters belonging to that class |
|
[=character_class=] represents an equivalence class. |
It matches all characters with the same collation value, including itself. |
For example, if o and (+) are the members of an equivalence class, then [[=o=]], [[=(+)=]], and [o(+)] are all synonymous. |
An equivalence class may not be used as an endpoint of a range. |
The following table lists the standard class names. |
alnum | Alphanumeric characters | alpha | Alphabetic characters | blank | Whitespace characters | cntrl | Control characters | digit | Digit characters | graph | Graphic characters | lower | Lowercase alphabetic characters | print | Graphic or space characters | punct | Punctuation characters | space | Space, tab, newline, and carriage return | upper | Uppercase alphabetic characters | xdigit | Hexadecimal digit characters |
|
mysql> SELECT 'ABC' REGEXP '[[:alnum:]]+';
+-----------------------------+
| 'ABC' REGEXP '[[:alnum:]]+' |
+-----------------------------+
| 1 |
+-----------------------------+
1 row in set (0.00 sec)
mysql>
mysql> SELECT 'ABC123' REGEXP '[[:alnum:]]+';
+--------------------------------+
| 'ABC123' REGEXP '[[:alnum:]]+' |
+--------------------------------+
| 1 |
+--------------------------------+
1 row in set (0.00 sec)
mysql>
|
|