【发布时间】:2013-06-21 17:11:37
【问题描述】:
根据这个post,我尝试使用^.*(?!http).*$查找所有不包含字符串http的行,但没有运气。
文字:
"NetworkError: 404 Not Found - http://wap-uat01.webuat.opg/finance/img/arrow.gif"
arrow.gif
GET http://wap-uat01.webuat.opg/site/brknews/xml/focus/focus_finance.xml?dummy=1372124875337
404 Not Found
19ms
xui-2.0.0.js(1221 line)
GET http://wap-uat01.webuat.opg/site/fin/xml/delay/topten/topStock_stock_up.xml?dummy=1372124875339
404 Not Found
23ms
xui-2.0.0.js(1221 line)
GET http://wap-uat01.webuat.opg/site/fin/xml/delay/topten/topStock_stock_down.xml?dummy=1372124875341
404 Not Found
22ms
xui-2.0.0.js(1221 line)
GET http://wap-uat01.webuat.opg/site/fin/xml/hotStock/fin_hotstock_utf8.xml?dummy=1372124875342
404 Not Found
27ms
xui-2.0.0.js(1221 line)
GET http://wap-uat01.webuat.opg/site/fin/xml/delay/index/u_HSI.xml?dummy=1372124875343
404 Not Found
32ms
xui-2.0.0.js(1221 line)
GET http://wap-uat01.webuat.opg/site/fin/xml/delay/index/u_HSCEI.xml?dummy=1372124875345
404 Not Found
32ms
xui-2.0.0.js(1221 line)
GET http://wap-uat01.webuat.opg/site/xml/polling.xml?dummy=1372124875346
对这个问题有什么想法吗?谢谢。
现场演示: http://regexr.com?35b85
【问题讨论】:
-
空格是否必要?我很想压缩它们……我认为这不会改变基本问题,对吧?
-
@icedwater 对不起,我不太明白你的意思
Is the whitespace necessary。 -
我的意思是可以删除文本行之间添加的空白行,但仍然不能改变您的问题是关于多行正则表达式的事实。例如,
404 Not Found <br/> 19ms看起来比404 Not Found <br/><br/><br/> 19ms更紧凑。 -
是的,可以删除文本行。
标签: javascript regex regex-negation