Extracting a string between an another string and a new line character

Need to extract the string which is in between of an another string and a new line

Eg.: Need to extract the bold part

Canada Address: Francis Sheckmahn
18, Ares De Sotires

reading the information gives me the characters \r\n after the bold part but how to use this to split the string?

Can anyone please help?



if you are getting \r
then use


Thanks @ImPratham45. That worked perfectly fine.

That worked perfectly fine and also I tried understanding the code, it seems the code just uses the split operation twice and the new line character is kept in double inverted commas.

But just if possible can you suggest why the below code, which I tried earlier didn’t work out?


Here Regex are used
U can use either one which u comfortable with

Hi @ImPratham45

actually i just asked what is the error in the regex code. It’ll be more clear if I came to know the error.


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