一、使用MySQL正则表达式
1.1 基本字符匹配
select vend_id, prod_price, prod_name from products where prod_name regexp '1000';
1.2 进行or匹配
select vend_id, prod_price, prod_name from products where prod_name regexp '1000|2000';
1.3 匹配几个字符之一
select vend_id, prod_price, prod_name from products where prod_name regexp '[123] ton';
1.4 匹配范围
select vend_id, prod_price, prod_name from products where prod_name regexp '[1-5] ton';
1.5 匹配特殊字符
select vend_id, prod_price, prod_name from products where prod_name regexp '\\.';
1.6 匹配字符类
存在找出经常使用的数字、所有字母字符或所有数字字母字符等的匹配。
1.7 匹配多个实例
对匹配的数目进行更强的控制。
1.8 定位符
为了匹配特定位置的文本。