jjt二向箔

关注

python正则表达式去除html标签的属性?

jjt二向箔

关注

阅读 79

2022-10-03


import re
test='<p class="pictext" align="center">陈细妹</p>'
test=re.sub(r'(<[^>\s]+)\s[^>]+?(>)', r'\1\2', test)
print(test)

输出

<p>陈细妹</p>


相关推荐

ITWYY

正则表达式-正则表达式的使用

ITWYY 243 0 0

闲嫌咸贤

正则表达式—基础正则表达式

闲嫌咸贤 31 0 0

weednoah

html 正则表达式 相关

weednoah 210 0 0

吃面多放酱

python—正则表达式

吃面多放酱 30 0 0

49路末班车

python 正则表达式

49路末班车 66 0 0

sin信仰

Python ❀ 正则表达式

sin信仰 99 0 0

舟海君

Python 正则表达式

舟海君 64 0 0

诗远

PYthon正则表达式

诗远 21 0 0

雪域迷影

【python】正则表达式

雪域迷影 151 0 0

穆熙沐

【Python】正则表达式

穆熙沐 150 0 0

精彩评论(0)

0 0 举报