用正则匹配<div class="WordSection1" style="layout-grid:15.6pt;">中WordSection1" 后的所有内容
时间: 2023-07-19 17:35:02 浏览: 52
用正则表达式匹配格式
可以使用以下正则表达式进行匹配:
```python
import re
text = '<div class="WordSection1" style="layout-grid:15.6pt;">'
pattern = r'WordSection1"[^>]*>(.*?)<'
match = re.search(pattern, text)
if match:
print(match.group(1))
else:
print("No match")
```
输出结果为:
```
style="layout-grid:15.6pt;"
```
阅读全文