匹配特定html标记之外的文本

问题描述 投票:0回答:1

受此question的启发,如何匹配特定HTML标记之外的文本?

目标文本:“ thespecialone”排除HTML标记:脚本

<div>
    <h1>thespecialone<h1> <= should match
</div>
<script>
   var blah = 'thespecialone'; <= should not match
</script>
javascript html regex regex-lookarounds
1个回答
0
投票
© www.soinside.com 2019 - 2024. All rights reserved.