Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Try using word boundary (\b)
\b
(<(?:b|img)\b[^>]*>)|<[^>]+>
Regex Demo
您可以在开盘时b或之后使用负前瞻:img<
b
img
<
(<(?!(?:b|img)\b)[^>]+>)
正则表达式 101 上的演示