duanmu5039 2013-02-28 20:06
浏览 158

正则表达式检索不包含特定字符串的所有URL

I am using the Google Analytics PHP API, and trying to use it to retrieve the most popular links on my website.

It works, but it retrieve some duplicates due to it retrieving URLs containing query strings. So basically, I want to retrieve all the links which do not contain the string "?start=" inside them. I think this can be done via regex (Google Analytics accepts regex filters), but don't know how.

Any ideas?

Thanks!

  • 写回答

1条回答 默认 最新

  • drsw9390405 2013-02-28 20:07
    关注

    You can use negative look ahead regex assertion.

    See http://www.perlmonks.org/?node_id=518444 and http://www.regular-expressions.info/lookaround.html

    your_string(?!\?start=)
    
    评论

报告相同问题?

悬赏问题

  • ¥40 复杂的限制性的商函数处理
  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码