RegEx to fetch Next Line data till a character

Could someone help me getting the selected text from the below text

Shipping Address :

Sandeep Nain
ABC Photo Studio
ASF building,
NEAR GOvernmen, XYZ
Gurgaon, Haryana, 122003
IN
State/UT Code: 06

I only want the Bold(italic) text, Could someplease suggest the RegEx for this?

I am using: (?<=Shipping\s.+\r?\n)([^:3]+) which gives me data till it reaches digit 3, not only its the wrong way of using the expression(can have multiple 3 in address) , but also its not giving me the complete code:->

Sandeep Nain
ABC Photo Studio
ASF building,
NEAR GOvernmen, XYZ
Gurgaon, Haryana, 12200

If the address always ends with 6 digits:

(?<=Shipping\s.+\r?\n)[\s\S]+?\d{6}

If the address always consists of 5 lines:

(?<=Shipping\s.+\r?\n)(.+\r?\n){5}

Thank you for the help!!!

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.