一、使用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 定位符
爲了匹配特定位置的文本。