2

I have the below response from the API:

{"info":{"message":"success","details":{}},"data":"https://127.0.0.1:80/view-report?https://routethis.creativeadvtech.ml/api/v1/report/get_subscriber_report?verification_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ2aWV3X3JlcG9ydF90b2tlbiIsImlhdCI6MTY0NDQyNzEzNSwibmJmIjoxNjQ0NDI3MTM1LCJqdGkiOiJhOTFlZWY0Ny01ZWY1LTQ3YWEtYTc0Ny1mYTNhOWM4MWRmNjMiLCJ0eXBlIjoiYWNjZXNzIiwiZnJlc2giOmZhbHNlLCJyZXBvcnRfaWQiOiI1YzQxYzU4MC04OWNjLTExZWMtOWM4Zi1hNjkzNGQ4NWQxMDkiLCJjdXN0b21lcl9pZCI6ImY2MGIyMjc0LWQ2MTAtNDBkMS1iNjJjLTc5NTEwOWZjMjk0ZiJ9.ica2CS-cT3RxbNPhMUn1Tw_HGtODmgAzS_JpjoS22NU"}

Question: How to extract the Verification_token value only notice that the whole data response is a full value attached to each other?

enter image description here

1 Answer 1

2

Your regular expression extracts the whole contents of data attribute, why would you expect it to return the partial value.

If you need the token only - you need to amend your regular expression to something like:

{"info":{"message":"success","details":{}},"data":".*verification_token=(.+?)"}

Demo:

enter image description here

More information:

1
  • Thank you soo much , it works :D
    – SDiab
    Feb 10, 2022 at 9:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.