如何在标签中查找报价? [英] How to Find Quotes within a Tag?
本文介绍了如何在标签中查找报价?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个这样的字符串:
I have a string like this:
这个是非常美好"的一天!
This <span class="highlight">is</span> a very "nice" day!
我在 VB 中的 RegEx-pattern 应该是什么样的,才能在标签中找到引号?我想用什么来代替它...
What should my RegEx-pattern in VB look like, to find the quotes within the tag? I want to replace it with something...
这个是非常美好"的一天!
This <span class=^highlight^>is</span> a very "nice" day!
像 <(")[^>]+> 这样的东西不起作用 :(
Something like <(")[^>]+> doesn't work :(
谢谢
推荐答案
这取决于您的正则表达式风格,但这适用于大多数:
It depends on your regex flavor, but this works for most of them:
"(?=[^<]*>)
对于任何好奇这是如何工作的人.这翻译成英语为找到一个引用,在下一个 < 之前跟一个 >".
For anyone curious how this works. This translates into English as "Find a quote that is followed by a > before the next <".
这篇关于如何在标签中查找报价?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文