Python之re操作方法(详解)
作者:jingxian 时间:2022-05-15 18:38:15
一:re.search():search返回的是查找结果的对象,可以使用group()或groups()方法得到匹配成功的字符串。
①group() 默认返回匹配成功的整个字符串(忽略pattern中的括号),也可以指定返回匹配成功的括号中第几个字符串(从1开始计数);
②groups() 以元组的形式返回匹配成功的pattern中括号中的内容,若pattern中没有括号,则返回空元组。
标签:Python,re,操作
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
js实现登录验证码
2023-09-06 05:43:27
一文带你了解Python枚举类enum的使用
2022-05-27 07:46:51
Python命令行库click的具体使用
2023-07-05 02:51:16
Python中11种NumPy高级操作总结
2023-07-31 00:00:28
![](https://img.aspxhome.com/file/2023/7/115187_0s.jpg)
PHP适配器模式Adapter Pattern的使用介绍
2023-06-10 12:28:21
Python小白垃圾回收机制入门
2022-05-20 04:38:42
js实现鼠标切换图片(无定时器)
2023-09-07 02:44:58
详解python itertools功能
2022-12-05 23:07:31
Python快速排序算法实例分析
2021-10-23 09:14:37
![](https://img.aspxhome.com/file/2023/4/72014_0s.png)
Python OpenCV特征检测之特征匹配方式详解
2021-07-20 00:51:58
![](https://img.aspxhome.com/file/2023/0/77580_0s.jpg)
Python DataFrame使用drop_duplicates()函数去重(保留重复值,取重复值)
2023-09-29 20:42:35
![](https://img.aspxhome.com/file/2023/8/109558_0s.png)
用js限制网页只在微信浏览器中打开(或者只能手机端访问)
2023-09-24 00:11:25
python实现RSA加密(解密)算法
2023-04-20 06:12:15
![](https://img.aspxhome.com/file/2023/8/107088_0s.png)
laravel 实现阿里云oss文件上传功能的示例
2023-06-13 20:39:26
![](https://img.aspxhome.com/file/2023/2/55532_0s.jpg)
Python网络编程详解
2022-01-09 15:25:10
python 美化输出信息的实例
2022-04-15 09:53:54
![](https://img.aspxhome.com/file/2023/7/79757_0s.jpg)
Bootstrap 模态对话框只加载一次 remote 数据的完美解决办法
2023-08-06 15:58:18
![](https://img.aspxhome.com/file/2023/0/55970_0s.png)
Oracle9iPL/SQL编程的经验小结
2010-07-23 12:49:00
ASP代码中的容错机制
2008-10-19 17:30:00
ini_set的用法介绍
2023-11-15 07:31:56