0

我想知道什么是正确的正则表达式:

In an action unprecedented during 12 years of war in Afghanistan, the commandant of the Marine Corps is firing two top generals. See why: 

<a onmouseover="LinkshimAsyncLin.swap()>Generals fired over Taliban attack </a><br/>security.blogs.cnn.com<br/>There were three investigations of the incident.

我想做以下事情:

给我字符串开始,a tag 它包含 onmouseover="LinkshimAsyncLin.swap()在属性区域的任何位置..并以剩余字符串的结尾结束..我的意思是从这个标签到字符串的结尾

笔记 :

我的朋友们,我知道使用带有 html 标签的正则表达式是非常糟糕的做法,我已经有很多红色了,但我想要特殊情况

4

1 回答 1

0

尝试这个:

(?i)[^<>]++(?=<a\\b(?>[^>o]++|\\Bo++|o(?!nmouseover\\b))++onmouseover\\s*=\\s*[\"']?LinkshimAsyncLin\\.swap\\(\\)(?>[\"']|\\s|(?=>)))
于 2013-10-01T21:11:21.707 回答