I have a target string like:
"addr: line1
line2
tel:12345678"
note: between line2 and tel, there might be 1 or multiple new lines:\r\n or \r\n\r\n or more. The result I want to get is as below:
"addr: line1
line2"
no \r\n under line2.
My questions are:
1)If I use
/addr[\s\S]+(?=(\r\n)+tel)/
, i will get the addr without tel, but I can't get rid of "\r\n"s under "line2", how could I do that?
2)I know [\s\S] represents any characters including \r,\n, and (.|\n|\r) can do that too. But why [.\n] can't? It's just like the syntax of[\s\S] isn't it?
Thank you very much!