python re正则表达式:字符类匹配
2019-01-21 11:54
393 查看
字符类:只要匹配字符类里的任意字母,都算匹配,’-’:表示范围
import re
re.search(r’[0-9]’,‘I love 123fish.com’)
<_sre.SRE_Match object; span=(7, 8), match=‘1’>
re.search(r’[a-z]’,‘I love 123fish.com’)
<_sre.SRE_Match object; span=(2, 3), match=‘l’>
相关文章推荐
- python正则表达式 re (二)匹配对象和组
- 【学习python】re 正则表达式匹配特定词性的conll,提取句子主干(主谓宾)
- Python正则表达式匹配操作re模块
- 正则表达式(re模块,匹配单个字符,匹配多个字符,匹配分组,python贪婪和非贪婪,r的作用)
- 【Python3 爬虫】09_正则表达式(re.math()、re.search()、re.sub()、全局匹配函数)
- 使用Python正则表达式RE从CSDN博客源代码中匹配出博客信息
- python re 正则表达式总结 匹配指定字符
- Python: 字符串搜索和匹配,re.compile() 编译正则表达式字符串,然后使用match() , findall() 或者finditer() 等方法
- python正则表达式re匹配模式和特殊字符集
- python re正则表达式:设定匹配次数
- python中的正则表达式(re模块)
- Python中re(正则表达式)学习
- Python re正则表达式速查
- python正则表达式同时匹配多个关键字(多关键字匹配)
- Python::re 模块 -- 在Python中使用正则表达式
- Python---re模块 正则表达式的
- Python 正则表达式 re模块
- python中re(正则表达式)模块的学习
- 常用的正则表达式匹配(Python)
- Python正则表达式匹配中文