regex - Matching last line from string \n\\\\\n[^] ] b -


i have string

\n\\\\\n[^] ] b 

(litteraly)

\\ [^] ] b

i match last line of string.

i tried use regexp \n.*$ , not working. if use \\\\n.*$ work need find universal solution because if have string \nx\n[^] ] b not work.

thank advice.

edit: i'm trying match pattern in sed pattern space. don't know if act same normal regex newline character. looks like:

patt:\n\\\\\n[^] ] b$ s/\n.*$// 

[^\n]*$ 

you can last line using this.see demo.

https://regex101.com/r/pg1ku1/27


Comments