Regular Expressions (RegEx) are advanced search patterns to match multiple URLs by providing conditions. This match type helps in defining a search pattern in which the Experiments should run.


Regex is the most complex form of URL targeting and requires the use of regular expressions. Using different regular expressions, you can target a wide range of pages. This form of URL targeting is the most helpful for targeting multiple pages simultaneously.


Given below are some of the examples in RegEx match type:



            You can use the regex pattern:
             https://www.test.com/app-[0-9]+/

            You can use the regex pattern:
            https://test.com/app[a-z0-9]*.html


           You can use the regex pattern:

           https://test.com/app-(11|22)


           You can use the regex pattern:
           https://test.com/app/(?!uk).*/products

           

     By using the above-mentioned regex pattern, you can exclude all the pages with UK string after the /app/ in the domain URL. Some of the pages(example) which will be tracked are:


            You can use the regex pattern:
            https?://(www.)?test.com/.*/(categories|products)/.*

            
            RegEx characters used in the above example are explained as follows
           
            https? - Tracks both http as well as https
            (www.)? - Tracks the pages with our without www in the URL
            
            Here, both http://www.test.com and https://test.com will be tracked