基本字符匹配
select pro_name from products where prod_name regexp 'ee'; // 基本字符匹配 select pro_name from products where prod_name regexp '.00'; // 含有00,前面有一个任意字符
进行Or匹配
select prod_name from products where prod_name regexp '1000|2000|a'; // or匹配
匹配几个字符之一
select prod_name from products where prod_name regexp '[123]'; // []匹配
匹配范围
select prod_name from products where prod_name regexp '[1-9]'; // 匹配范围
匹配特殊字符
select vend_name vends where vend_name regxp '\\.'; // \\转义字符 select vend_name vends where vend_name regxp '\\['; // \\转义字符 select vend_name vends where vend_name regxp '[[:lower:]]'; // 使用预定义的字符集
select vend_address from vendors where vend_address regxp '[[:gigit:]]{3,}'; // 重复元字符
select prod_name from products where prod_name regexp '^[0-9\\.]';