正则表达式匹配两个特殊字符中间的字符串。
- (?<=A)(.*)(?=B) 不包含前面匹配的字符写法(?<=要匹配的开始字符),不包含后面要匹配的字符写法(?=要匹配的结束字符)。例如:现在要提取
<task>与 </task>之间的字符串(不包括<task> </task>
这两个字符)
a = <task>Multi-feature combined cloud and cloud shadow detection</task>
m = re.findall('(?<=<task>)(.*)(?=</task>)', a