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.
我只想删除类为“邻居”的跨度标签。而且我不想删除其余的跨度标签。我只想使用正则表达式,我别无选择。
<span class="latitude">34.008253</span> <span class="longitude">-118.414593</span> <span class="neighborhood">Neighborhood: Clarkdale</span>
请帮帮我。谢谢你
试试这个:
@"<span class=""neighborhood"">[^<]*</span>"
假设在 span 之前没有关闭其他标签,这将起作用。此外,HTML 允许大量空白,因此您可能需要对其进行调整。