This is a migrated thread and some comments may be shown as answers.

Find with Regex by FiddlerScript

1 Answer 791 Views
Windows
This is a migrated thread and some comments may be shown as answers.
thang
Top achievements
Rank 1
Veteran
thang asked on 21 Mar 2021, 03:09 PM

Hello!

Example response body:

{"itemid": 1234,"total_payable":10000,"userid":5678}

I want find string: "total_payable":10000 then var numberpay = 10000 (10000 could be any other value).

i have idea in javascript:

var body = oSession.GetResponseBodyAsString();

var keypay0 = body.match(/\"total\_payable\"\:(\d+)\,/g);
var keypay = keypay0.toString();
var numberpay0 = keypay.match(/(\d+)/g);
var numberpay = parseInt(numberpay0);

Can you help me convert to FiddlerScript?

Sorry for my english!

Thank you so much!

1 Answer, 1 is accepted

Sort by
0
Nick Iliev
Telerik team
answered on 22 Mar 2021, 06:40 AM

Hello Thang,

 

FiddlerScript is based on JScriptNET which is a NET version of JavaScript so you should be able to use very similar or almost identical language structure in 99% of the cases. That said, you could also take a look at this forum post for a reference for the FiddlerScript code you are looking for.

 

Regards,
Nick Iliev
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
Windows
Asked by
thang
Top achievements
Rank 1
Veteran
Answers by
Nick Iliev
Telerik team
Share this question
or