Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fiddler Autoresponder: Regex replacement not working

I have a regex rule and an action that returns a file from a local cache. The rule captures what I want it to, but the problem is $2 in the action is not handled, so Fiddler tries to return D:\path\$2 (and fails). What could be wrong?

Rule:

regex:(?insx).*(host1.com|host2.com)/folder1/folder2/(.*)\?rev=.*

Action:

D:\path\$2

Any help would be appreciated.

P.S. I'm using Fiddler v2.4.8.0

like image 512
user2286759 Avatar asked Mar 19 '23 04:03

user2286759


2 Answers

After loosing an interesting amount of hair with this, I achieve it 'naming' the group replacement, like this:

Rule:

regex:(?insx).*(host1.com|host2.com)/folder1/folder2/(?'mygroup'.*)\?rev=.*

Action:

D:\path\${mygroup}
like image 148
John Bernardsson Avatar answered Apr 12 '23 05:04

John Bernardsson


When you're using group replacements like this, it's important to put ^ at the front of the Rule expression and $ at the end.

like image 32
EricLaw Avatar answered Apr 12 '23 03:04

EricLaw