I understand that using regex to parse html is frowned upon, but this is the solution I want to try first.
I am trying to match
what a great sentence this is
as well as any characters or spacing that comes in between those words
in the following string:
<p>
what is going on with you?
</p>
<p>
what a great
</p>
<p>
sentence this is
</p>
<p>
How is your family?
</p>
The regex I am using is:
what.*a.*great.*sentence.*this.*?is
I know the .*? before 'is' is stopping my regex from matching up to 'How is' in the final p tag. But I cannot figure out what to put near the beginning to stop the match from starting at 'what is going on' in the first p tag
I am viewing the output from https://regex101.com/r/kZWYR7/1 to verify that it is not working as intended.
Please help, I feel there is a crucial lesson I am missing with regex that is stopping me from figuring this out.
Expected match would be:
what a great
</p>
<p>
sentence this is
EDIT: Clarifying my problem and how it is different than the duplicate