How to extract values using findBetween when right boundary is end of line

The response body (stored in variable res) looks something like below

*Found. Redirecting to https://subDomain.domain.com/queryParam?numA=111111111&numB=22222222&numC=33333333

I just want to extract numC using findBetween

let numC = findBetween(res.body, ‘&numC=’, ‘’);

I have tried carriage return and line break \r\n but it is capturing null in all cases unfortunately. I guess I am missing something basic in JS.

Can someone help please

Hi @abhiperf,
welcome to the community forum :tada:

It is not expected to use findBetween without the right part. In that case, you can use just indexOf or search.

1 Like