博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
mysql中的正则表达式
阅读量:4618 次
发布时间:2019-06-09

本文共 693 字,大约阅读时间需要 2 分钟。

  mysql中的正则表达式表示方式跟linux中其实是一样的,mysql通过REGEXP命令提供正则表达式功能:

a(m,n)匹配m到n个a

a(,n)匹配0到n个a

 

root@localhost:cyz--08:14:42 >create table test(id int auto_increment primary key,email varchar(20));

Query OK, 0 rows affected (0.01 sec)

root@localhost:cyz--08:15:03 >insert into test values(1,'abc@163.com'),(2,'def@162.com'),(3,'jjj@111.com');

Query OK, 3 rows affected (0.00 sec)
Records: 3 Duplicates: 0 Warnings: 0

root@localhost:cyz--08:16:14 >select * from test where email regexp '[1.]';

+----+-------------+
| id | email |
+----+-------------+
| 1 | abc@163.com |
| 2 | def@162.com |
| 3 | jjj@111.com |
+----+-------------+
3 rows in set (0.00 sec)

转载于:https://www.cnblogs.com/kucha/p/4837633.html

你可能感兴趣的文章
vi/vim使用
查看>>
讨论Spring整合Mybatis时一级缓存失效得问题
查看>>
Maven私服配置Setting和Pom文件
查看>>
Linux搭建Nexus3.X构建maven私服
查看>>
Notepad++使用NppFTP插件编辑linux上的文件
查看>>
NPOI 操作Excel
查看>>
MySql【Error笔记】
查看>>
vue入门
查看>>
JS线程Web worker
查看>>
Flex的动画效果与变换!(三)(完)
查看>>
mysql常见错误码
查看>>
Openresty 与 Tengine
查看>>
使用XV-11激光雷达做hector_slam
查看>>
布局技巧4:使用ViewStub
查看>>
ddt Ui 案例2
查看>>
拿下主机后内网的信息收集
查看>>
LeetCode 876. Middle of the Linked List
查看>>
作业一
查看>>
joj1023
查看>>
动画原理——旋转
查看>>