I'm trying to use a regex that recognizes multiple lines of text and stops when a certain character is found, in this case the # character. I used
##[a-zA-Z][\s\S]*?(?=\n.*?)
but I don't quite understand what to add to the regex to make it find multiple lines that follow a specific list pattern (* or ##)
Any help would be greatly appreciated.
Here is the test string in regex101.com
Sample Text
## SECTIONS
* [Congress]
* [White House]
* [Magazine]
* [The Agenda]
* [Video]
* [Podcasts]
## 2020 Elections
The expected output is everything from the first ## to the last ##. I want the returned result to include this. Sorry forgot to update the regex.