Skip to main content

Regex (Regular Expression)

Use Wildcard and Regex matching rules in Proxyman tools such as Map Local and Breakpoint, and test your rule against sample URLs before you save it.

1. What's it?โ€‹

From version 2.3.0, Proxyman supports Wildcard and Regex (match whole words) when you define matching rules for all debugging tools:

It helps you define exactly which requests trigger the tool.

Proxyman Map Remote rule list with one Regex rule and two Wildcard rules in the Matching Rule column

Wildcard and Regex rules

2. Test your URL (New feature ๐ŸŽ‰)โ€‹

From Proxyman v4.8.0, you can quickly test your rule (Wildcard or Regex).

  • Quickly test and try out your Wildcard or Regex rule.
  • Save time: You don't need to go back and forth to check your URL.
  • Make fewer mistakes.
Proxyman Test Rules window checking the wildcard http://localhost:3000/* against three URLs, Matched or Not Matched

Test a rule against your URLs

How to use it?โ€‹

  1. Open any debugging tool (Breakpoint, Map Local, ...) and create a new rule.
  2. Click the Test your Rule button. The Test Rules window opens.
  3. Add your rule and the URLs you want to check.
  • :white_check_mark: Matched: Your URL matches your rule.
  • โš ๏ธ Not Matched: Your URL doesn't match your rule. You might need to rewrite your Wildcard or Regex rule.

3. Wildcardโ€‹

Proxyman supports two simple Wildcard characters: * and ?

WildcardPurpose
*The asterisk in a wildcard matches any character zero or more times.
?A question mark matches a single character once.

For instance:

4. Regexโ€‹

Proxyman also supports Regex.

  • Make sure your regex matches the whole URL.
  • A partial match counts as not matching.
  • Make sure you escape characters properly: slash (/), dot (.), etc.

For instance:

RegexMatched URL Examples
https:\/\/proxyman\.io.*

https://proxyman.io
https://proxyman.io/v1/data?id=123
https://proxyman.io/pricing

^(http|https):\/\/www\.google\.com.*

http://www.google.com
http://www.google.com/user?id=proxyman
https://www.google.com

^(http|https)?:\/\/www\.google\.com\/v[0-9]?\/build\?query=proxyman

http://www.google.com/v1/build?query=proxyman
www.google.com/v2/build?query=proxyman

You can use regex101 to check that your regex matches the whole URL.

regex101 test with a regex that fully matches three google.com URLs
info

Proxyman uses Apple's NSRegularExpression. Check the Regex metacharacters, operators and flags in the Apple Developer documentation to see which ones are supported.

info

Check your regex on regex101.com and make sure it fully matches the given URL.

  • Select Use Regex when you create a rule.
info

With regular expressions, ? and * mean something different than in wildcards. The wildcard ? is the regex . and the wildcard * is the regex .*