Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/regex/20.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Regex 正则表达式检查多个URL';s_Regex - Fatal编程技术网

Regex 正则表达式检查多个URL';s

Regex 正则表达式检查多个URL';s,regex,Regex,我正在尝试检查URL是否等于以下任何URL,但我无法让它工作 Regex检查将在Google Event Manager中实现,以检查Twitter、Facebook、YouTube、RSS和Google的社交点击+ 我尝试单击URL匹配正则表达式: twitter.com/example | facebook.com/example | youtube.com/c/example | example.com/feed/rss/| google.com/b/1077793919321526685

我正在尝试检查URL是否等于以下任何URL,但我无法让它工作

Regex检查将在Google Event Manager中实现,以检查Twitter、Facebook、YouTube、RSS和Google的社交点击+

我尝试单击URL匹配正则表达式:


twitter.com/example | facebook.com/example | youtube.com/c/example | example.com/feed/rss/| google.com/b/107779391932152668583/+example/

在模式中需要转义的特殊字符只有

  • 圆点
  • 加号
GA regexp不使用regdx分隔符,因此您不必转义正斜杠(您需要它们在在线regex测试人员处进行测试)

使用


你需要避开所有的句点
成为
\.
,可能还有所有的
/
成为
\/
…这是关于谷歌标签管理器的吗?谢谢l'l,成功了!:)还有一件事。。。你知道我如何在:
google\.com\/b\/107779391932152668583\/+Example\/
中写+吗?我怀疑你是否需要避开前斜杠。一个加号和一个点都应该转义:
google\.com/b/107779391932152668583/\+Example/
除了google+帐户之外,一切都运行得很好。有什么想法吗?我想这和+
google\.com/b/107779391932152668583/\+username/
尝试将加号放在括号中<代码>[+]。仍然无法使Google+URL正常工作。很奇怪。。。。我以为[+]会起作用……你确定这是一个文字加号,而不是呈现的HTML实体吗?尝试将
\+
替换为
%43
&43或类似的东西。
twitter\.com/example|facebook\.com/example|youtube\.com/c/example|example\.com/feed/rss/|google\.com/b/107779391932152668583/\+example/