正则表达式 非获取匹配

 

1、我要匹配非以.html结尾的链接,

  匹配 http://www.wandoujia.com/apps/com.freeapp.batterysaver,但过滤掉 以.html结尾的链接,

如 http://www.wandoujia.com/apps/com.freeapp.batterysaver.html

 

正则式如下

http://www\.wandoujia\.com/apps/(?![a-zA-Z0-9_\-\.]+?\.html).*$

 

关键点是 (?!.*非内容).*

 

参考资料:

1、 正则表达式匹配 非XXX的行  http://www.jb51.net/article/15146.htm

 

posted @ 2017-05-09 21:05  xunux  阅读(345)  评论(0编辑  收藏  举报