jjt二向箔

关注

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

jjt二向箔

关注

阅读 82

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 250 0 0

闲嫌咸贤

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

闲嫌咸贤 41 0 0

weednoah

html 正则表达式 相关

weednoah 211 0 0

吃面多放酱

python—正则表达式

吃面多放酱 41 0 0

猎书客er

Python的正则表达式

猎书客er 301 0 0

舟海君

Python 正则表达式

舟海君 64 0 0

49路末班车

python 正则表达式

49路末班车 67 0 0

sin信仰

Python ❀ 正则表达式

sin信仰 104 0 0

phpworkerman

python正则表达式

phpworkerman 121 0 0

千白莫

Python正则表达式

千白莫 193 0 0

精彩评论(0)

0 0 举报