Mega Code Archive

 
Categories / MySQL / Regular Expression
 

Square brackets indicate a selection from among several characters, a hyphen is used to indicate a range of ch

aracters mysql> mysql> for example, a-c indicates the inclusive range from a to c. The operator + indicates that at least one of the characters must appear at least once in the search expressio n: mysql> mysql> mysql> SELECT 'cde' REGEXP '[a-c]+', 'efg' REGEXP '[a-c]+'; +-----------------------+-----------------------+ | 'cde' REGEXP '[a-c]+' | 'efg' REGEXP '[a-c]+' | +-----------------------+-----------------------+ |                     1 |                     0 | +-----------------------+-----------------------+ 1 row in set (0.00 sec) mysql>