我有一个段落,其中一些文本被一个特定的html标签包围。我需要找到没有被那个特定的html标签包围的文本。例如
AVG Antivirus for Smartphones and Tablets detects harmful apps and SMS.
<font color='black'>AVG</font> Mobilation™ AntiVirus Pro for Android™ is a mobile security
solution that helps protect your mobile device from viruses, malware, spyware and online
exploitation in real-time. avg blah blah...我想找到不包含在<font color='black'> </font>中的单词AVG (不区分大小写)。它可以是单词的一部分,也可以是一个完整的单词。如果是文本的一部分,则包含单词AVG的整个单词不应包含在该html标记中
我怎样才能用Java做到这一点呢?
发布于 2012-10-16 12:58:44
请参阅http://www.regular-expressions.info/lookaround.html#limitbehind
如果你还没有,你可以尝试下面的内容:
(?<!<font color='black'>)AVG(?!</font>)https://stackoverflow.com/questions/12907679
复制相似问题