google 事件的正则表达式

RegEx for google event

你好,我想帮助编写一个正则表达式,捕获其中包含单词确认的所有 url。

例如: https://example.com/this-is-a-confirmation

https://example.com/confirmation

https://example.com/folder/this-is-confirmation

我正在尝试设置一个目标,以捕获对网站上任何确认页面的所有访问,因为通过访问该页面,您很可能会填写表格来下载资产

谢谢!

所以,基本上所有链接都以确认结束?

那么你可以只使用一个非常愚蠢和简单的正则表达式,比如:

confirmation$

如果您只希望 URL 包含确认信息:

confirmation

已经足够了 (Demo)。这与使用 String.endsWith(str)String.contains(str).

基本相同

根据您对此进行评估的方式,您可能需要在搜索词之前允许字符以产生完全匹配(而不仅仅是部分匹配):

.*confirmation

.*confirmation.*

如果您想在搜索词后允许任何文本。