I have some text (which some of you will recognize as part of a fortune file)
A day for firm decisions!!!!! Or is it?
%
A few hours grace before the madness begins again.
%
A gift of a flower will soon be made to you.
%
A long-forgotten loved one will appear soon.
Buy the negatives at any price.
%
As can be seen, this contains both single line text and block text (as seen in the last fortune).
I currently have a regex that will capture all single line fortunes, however, it does not capture the multiline fortune.
(?<=%\n)(.*?)(?=\n%)
I understand that there is a /m
multiline option, however, I do not want the entire regex to be multiline enabled (I have not gotten it to work at all in that way).
So my question is: How can I select multiline text blocks between delimiters as a local capture group? It should be noted that I will be using this in JavaScript.