June 30, 2023
Use Cases
min read

Requestly Rule Operators

On this page

When you create a modification rule, you will find the following operators – Equals, Contains, Matches (Regex), Matches (Wildcard). In this article, we explain these operators and use cases.

Equals Operator

Equals operator does strict matching of Url intercepted by Chrome with the Url given in rule.

Please note that when you open in browser, url intercepted is Note a trailing ‘/’ slash at the end of Url.
So a rule with Equals operator and Url as does not match So consider adding Slash (‘/’) at the end of url in your rule. You can alternatively create two pairs in the same rule as well.

Url given in Rule:
Intercepted Url:
Result: Does not match (Observe trailing slash)

Contains Operator

Contains operator does a substring search of string provided in rule inside the Url intercepted by Chrome.


String in Rule: yahoo
Intercepted Url:
Result: Match


String in Rule: com?a=1
Intercepted Url:
Result: Does Not Match

Regex Match Operator

Regex Match Operator matches a given Regex with the Url intercepted by chrome. You can also use the values of group expressions in your destination Urls.


Url Matches (Regex) /(.+)\.google/ig
Destination https://$

In this case, above regex will be matched with intercepted Url. If regex is matched then $1 will be replaced in the destination Url and redirect happens to destination url.

Wildcard Match Operator

Wildcard match operator matches expression with the Url intercepted by chrome. We only support asterisk (*) as wildcard operator. * can match 0 or more characters in intercepted url. Please note that in wildcard match, complete url is matched with given expression and *’s can be replaced with respective values in destination Url.

Example 1:

Expression: *://*
Result: $1 = http, $2 = cricket

Example 2:

Expression: *yahoo
Result: Does not match. Note the trails does not match

Example 3:

Expression: *yahoo*
Result: $1 = http://www. $

Example 4:

Expression: http://*
Result: Does not match (Observe the trailing slash in Url)

Thank you for reading this document. Please let us know in comments if something needs to be improved.

Requestly is an Open-Source frontend development platform with essential tooling & integrations that helps frontend developers write, test & debug their code 10x faster. Using Requestly, you can create mock API endpoints, test, validate & override API responses, modify request & response headers, setup redirects (Map local, Map remote) and use Requestly sessions for faster debugging.


Ready to get started?

Empowering frontend developers to achieve more in development, testing & debugging workflows.