I want to find the string "wallet":10000000, and use oSession.utilFindInResponse(/"wallet":([0-9.]+),/,0); but return -1.
How do I use regular expressions to search for a string FiddlerScript?
I want to find the string "wallet":10000000, and use oSession.utilFindInResponse(/"wallet":([0-9.]+),/,0); but return -1.
How do I use regular expressions to search for a string FiddlerScript?
oSession.utilFindInResponse is according to the Fiddler documentation defined to perform a string search. Regular expressions are not mentioned and thus not supported using this command.
Assuming the response consists of text (e.g. a html page or a JSON file) you can get the response body as String and the apply the standard .Net commands for regular expression search:
var bodyString = oSession.GetResponseBodyAsString();
var regex = /\"wallet\":([0-9.]+)/;
if (regex.test(bodyString)) {
...
}