繁体   English   中英

正则表达式查找没有特殊字符的文本

[英]Regex to find the text without a special character

我有一个段落,其中一些文本被特定的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?

参见http://www.regular-expressions.info/lookaround.html#limitbehind

如果您还没有的话,可以尝试以下操作:

(?<!<font color='black'>)AVG(?!</font>)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM