Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Regex Checking Multiple URL's?

Tags:

regex

I'm trying to check if the URL equals to any of the below URLS but I can't get it to work.

The Regex check will be implemented in Google Event Manager to check social clicks for Twitter, Facebook, YouTube, RSS and Google+

I tried Click URL matches RegEx:

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

like image 817
squidg Avatar asked Sep 02 '26 13:09

squidg


1 Answers

The only special characters you need to escape in your pattern are

  • a dot
  • a plus symbol

GA regexps do not use regdx delimiters, thus you do not have to escape forward slashes (you need them to test at online regex testers).

Use

twitter\.com/example|facebook\.com/example|youtube\.com/c/example|example\.com/feed/rss/|google\.com/b/107779391932152668583/\+example/
like image 98
Wiktor Stribiżew Avatar answered Sep 04 '26 13:09

Wiktor Stribiżew