Home > Database > Mysql Tutorial > mysql中使用LIKE,正则_MySQL

mysql中使用LIKE,正则_MySQL

WBOY
Release: 2016-06-01 13:31:54
Original
1190 people have browsed it

bitsCN.com

mysql中使用LIKE,正则

 

LIKE

%  表示任何字符(NULL除外)出现任意次(0--无穷个)。同时还必须注意大小写问题。

_    表示任何字符出现1(不能多也不能少)次

 

正则模式

^ $ .(匹配任意单个字符,包括换行)

[]  |

 * + ? 

(m) (m,) (m,n) (,n) 

 

mysql> select 'abcdefg' REGEXP '^a'mysql> select 'abcdef' Regexp 'g$';mysql> select 'abcdef' Regexp '.f';mysql> select 'abcdef' Regexp '[fhk]';mysql> select  name,mail,from t where mail  Regexp '@163[.,]com$';mysql> select  name,mail,from t where mail  like '@163%.com' or mail  like '@163%,com';
Copy after login

 

 

 

bitsCN.com
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template