python re 匹配回车 re.DOTALL
来源:互联网 发布:知牛财经官网 编辑:程序博客网 时间:2024/05/12 03:58
#!/usr/bin/env python
import re
my_str = """accessTypeWeight:
- type: TAIR
weight: 1
tairConfigId: mcomm
tairNamespace: 5072
version: '0'
zone: mcomm.single"""
# extract tairConfigId
ret = re.match('.*tairConfigId:\s*(\w*).*', my_str, re.DOTALL)
if ret:
print ret.groups()[0]
import re
my_str = """accessTypeWeight:
- type: TAIR
weight: 1
tairConfigId: mcomm
tairNamespace: 5072
version: '0'
zone: mcomm.single"""
# extract tairConfigId
ret = re.match('.*tairConfigId:\s*(\w*).*', my_str, re.DOTALL)
if ret:
print ret.groups()[0]
0 0
- python re 匹配回车 re.DOTALL
- python re.sub 正则匹配
- Python中re进行匹配
- Python Re
- python re
- python re
- Python--re
- Python---re
- python re
- python re
- Python 模糊匹配:glob, re, fnmatch
- Python re - re module contents
- RE
- re
- re
- RE
- re
- re
- linux 光标快捷键
- oc 转c++的命令
- android wheelview实现三级城市选择
- 在VC++6.0中创建静态库
- centos 7安装mysql数据库
- python re 匹配回车 re.DOTALL
- 【一天一道LeetCode】#12 Integer to Roman
- ImportError: No module named _caffe
- 35年老程序员的最大遗憾:当程序员
- c3p0源码解析 二 (DriverManagerDataSource类)
- ACM内部函数--数学问题--大数相乘
- SSH反向连接及Autossh 实现外网访问内网树莓派
- Codeforces 639A Bear and Displayed Friends 【STL】
- hdoj 1437 天气情况 【打表模拟】