I'm kind of stuck with a very simple regex. I've already tried a lot of thing but without result so I'll go with the simple :
I want to get a multiline result (for replace it later but I have already wrote this part and it works good) which supposed to be between '#' char. here the sample file :
# Zulu 9.8.9.8
add method 9.8.9.8 {ssh} {telnet}
add password 9.8.9.8 {jouejoue}
add user 9.8.9.8 {Zekrom}
# Zulu 1.1.1.1
add method 1.1.1.1 {ssh} {telnet}
add password 1.1.1.1 {mypassword}
add user 1.1.1.1 {adminstyle}
# Zulu 2.2.2.2
add method 2.2.2.2 {ssh} {telnet}
add password 2.2.2.2 {diffpassword}
add user 2.2.2.2 {pixyokadi}
I used 's' option like '/regex/s' so " " will be count in '.' char. I wanted to use [^#] but it cancelled the 's' option. I don't know why but when using this one :
/#.*#/s
It takes the 2 first paragraph ignoring the '#' at line '# Zulu 1.1.1.1' and I don't understand why. I've tried to use capture-parenthesis too without success. I used to search the IP with a regex but since I can't even get the paragraph I wanted, I used a more simple one. Could someone explain this to me ?
https://regex101.com/r/tI4hQ7/2
Thanks for reading.