How do I match any line containing #Test
and also all next lines from it as long they start with:
- any amount of space followed by a
;
Example:
1. ; #Test
2. ; bbbb
3.
4. ; #Test
5.
6. ; aaa
Line 1 and 2 are one
match, line 4 another match
This is what i got atm:
\s*(#Test).*(\s*;.*)*
https://regex101.com/r/HvPAxt/1
My current doubt is how to stop matching when an empty line is found.
Example2:
1. ; #Test
2. ; bbbb
3.
4. xxxx
5. ; #Test
6. yyyy
7.
8. ; #Test
9.
10. ; bbb
Line 1 and 2 are one
match
Line 5 another match
Line 8 is another match.