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.
我正在使用以下正则表达式解析标记以匹配标记元素的内部文本。
(?<=<*>)[^<]+(?=<[^>]*>)
我想对此进行优化以删除空白处的匹配项。例如:>空格\n等<
例如:
<div> <div>TargetMatch</div> </div>
目标命中:
实际匹配:
有任何想法吗?
斯莱伊
图案:>\s+<
>\s+<
替代品:><
><