擅长:python、mysql、java
<pre><code><[^>]*>
</code></pre>
<p>您只需锁定“必须移除”目标,并匹配该目标,然后移除该目标</p>
<p>在python中</p>
<pre><code>ss="""<S>Today is a <unk> sunny day and <num> children are playing outside </S>"""
regx= re.compile(r'<[^>]*>')
print(regx.sub("",ss))
</code></pre>
<p>输出为</p>
<pre><code>Today is a sunny day and children are playing outside
</code></pre>