1

I have below text content:

trusted/75XqScyKRbuRYEATFl2cWg==:IUMN4RxUoWGSFvJMTJ69TkaA/t

Where I've to extract only 75XqScyKRbuRYEATFl2cWg==:IUMN4RxUoWGSFvJMTJ69TkaA text. Someone please help me to write a RegEx for this.

  • prescribing regex as the solution makes this a classic XY problem. This really looks like something you should be splitting on separators, not using regex for. – ernie Aug 17 '18 at 20:30
4

Try this one:

^trusted\/(.*)\/t$

This will return a string between trusted/ and /t if the original string starts from trusted/ and finishes with /t. Otherwise use just trusted\/(.*)\/t.

Check the test here: https://regex101.com/r/ZeiORB/1

UPD:

As per OP's comment here is a fixed regexp addressing the input from comment:

trusted\\\/(.*)\\\/t

Test: https://regex101.com/r/ZeiORB/2/

| improve this answer | |
  • Sorry above one i have mentioned was wrong following is the whole response – Ranganatha Reddy Aug 17 '18 at 10:44
  • I have the following whole response {"options":{"hideTabs":true,"hideToolbar":true,"width":0,"height":0},"url":"https:\/\/staging-athena.wkelmsolutions.com\/trusted\/ndr4JPOlT7uDzHGnPYXe3g==:X6IDO7mkZqzht_pe-GRZ-hSd\/t\/C09322\/views\/Leanbook\/LeanViz"} from above i have to extract ndr4JPOlT7uDzHGnPYXe3g==:X6IDO7mkZqzht_pe-GRZ-hSd – Ranganatha Reddy Aug 17 '18 at 10:47
  • @RanganathaReddy Check update regarding your comment – Alexey R. Aug 17 '18 at 10:53

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