例如
```python
s = '''
<div style="border-bottom: #cccccc 1px solid; border-left: #cccccc 1px solid; padding-bottom: 5px; background-color: #f5f5f5; padding-left: 5px; padding-right: 5px; border-top: #cccccc 1px solid; border-right: #cccccc 1px solid; padding-top: 5px" class="cnblogs_code">
<pre><span style="color: #000000">@count_time()
</span><span style="color: #0000ff">def</span><span style="color: #000000"> test():
sleep(</span>0.5<span style="color: #000000">)
</span><span style="color: #0000ff">if</span> <span style="color: #800080">__name__</span> == <span style="color: #800000">'</span><span style="color: #800000">__main__</span><span style="color: #800000">'</span><span style="color: #000000">:
test()</span></pre>
</div>
'''
```
想把div pre之间的片段弄出来,写到<div.*>\s*<pre>.* 就写不动了。
各位给支个招,谢谢!
```python
s = '''
<div style="border-bottom: #cccccc 1px solid; border-left: #cccccc 1px solid; padding-bottom: 5px; background-color: #f5f5f5; padding-left: 5px; padding-right: 5px; border-top: #cccccc 1px solid; border-right: #cccccc 1px solid; padding-top: 5px" class="cnblogs_code">
<pre><span style="color: #000000">@count_time()
</span><span style="color: #0000ff">def</span><span style="color: #000000"> test():
sleep(</span>0.5<span style="color: #000000">)
</span><span style="color: #0000ff">if</span> <span style="color: #800080">__name__</span> == <span style="color: #800000">'</span><span style="color: #800000">__main__</span><span style="color: #800000">'</span><span style="color: #000000">:
test()</span></pre>
</div>
'''
```
想把div pre之间的片段弄出来,写到<div.*>\s*<pre>.* 就写不动了。
各位给支个招,谢谢!