当前位置:网站首页>匹配任意两个字符的中间字符 RE
匹配任意两个字符的中间字符 RE
2022-07-21 05:24:00 【何强棒棒】
使用re库匹配任意两个特殊字符之间的字符
代码如下:
import re
re.findall("X(.*?)Y", l)
代码解读:
X,Y分别为两个特殊,l为字符串
实例:
import re
l = '12345667'
c = re.findall("3(.*?)7", l)
print(c)
# 输出:
# ['4566']
边栏推荐
猜你喜欢
如何将.sql文件导入到mysql中
新一代企业IT架构到底是什么?云原生?低代码?
小程序如何使用自定義導航欄
Mount local Yum source
【自然语言处理和文本分析】基本信息检索技术中的全面扫描法和逐项翻转法。
Uniapp usage chart
数据可视化第五章
【高级数据处理技术】数据过滤,高级数据填补,初,高级数据转化
Machine learning K-means - nonzero (clusterassment[colon, 0].a==cent
[feature learning] use association rules and neural networks to establish new features
随机推荐
uniapp使用图表
2694: inverse Polish expression
Several methods of quickly checking the local public IP
1.机器学习的基础概念
Dataframe counts the number of repetitions
Go learning notes - channel channel
结构化分析SD SASP
How to realize SKU screening of goods by applet
Uniapp usage chart
【自然语言处理与文本分析】文本特征提取方法总结。关键词提取方法。公认效果较好的IDF,RCF。
1. Basic concepts of machine learning
在vscode里配置rust时遇到error:linking with ‘x86_64-w64-mingw32-gcc‘failed:exit code:1
7月13日直播预告:方舟低代码平台直播来袭
小程序如何使用自定義導航欄
快速查看本机公网IP的几种方法
【 traitement du langage naturel et analyse de texte】 cet article présente la méthodologie de l'exploration de texte avec deux cas de projet.
Data visualization Chapter 5
Ue5 official case lyrastarter full feature explanation 4 Create team
统计一年中每个月的数据
[natural language processing and text analysis] overview of natural language processing