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?
IAmMilinPatel
7,7667 gold badges44 silver badges68 bronze badges
1 Answer 1
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:
More information:
answered Feb 10, 2022 at 4:56
-
Thank you soo much , it works :DSDiab– SDiab2022年02月10日 09:30:02 +00:00Commented Feb 10, 2022 at 9:30