How to URL match with exact match, simple match, contains & regex

Exact Match

Will match the url of the page exactly. Notice that browsers sometimes hides the last ”/” from the url field – even though it exists. To get the exact URL, type ”location.href” in the console.

Examples:

URL to match: https://www.sitegainer.com/

Match string: https://www.sitegainer.com/
Match string: https://www.sitegainer.com
Match string: http://www.sitegainer.com/
Match string: https://sitegainer.com/

Simple Match

Will match exactly the url of the page. But will remove the last /, https, https and so on.

Examples:

URL to match: https://www.sitegainer.com/?query=1#newvisitor

Match string: https://www.sitegainer.com/ => sitegainer.com
Match string: https://www.sitegainer.com => sitegainer.com
Match string: http://www.sitegainer.com/ => sitegainer.com
Match string: https://sitegainer.com/ => sitegainer.com
Match string: https://sitegainer.com/?query=1 => sitegainer.com
Match string: https://sitegainer.com/subpage => sitegainer.com/subpage

Contains

Will check if url contains the string.

Examples:

URL to match: https://www.sitegainer.com/?query=1#newvisitor

Match string: sitegainer
Match string: www
Match string: query
Match string: visitor
Match string: newvisitor
Match string: contact.php

Regex Match

Will check if the url matches the string by regex. Input string like this your regex /i.

Examples:

URL to match: https://www.sitegainer.com/?query=1#newvisitor

Match string: /sitegainer/i
Match string: /sitegainer\.com\//i
Match string: /http\:\/\/www\./i