I know I got BeautifulSoup, But I want to try my own.
<br>This Text needed
<a>unwanted text</a>
<br/>
This text needed
<a >unwanted text</a>
This text needed
<a>unwanted text</a>
<br>this text needed
What I have come up with:
(</a>|(<br(/>|>)))(\s.*|\w.*)
I want to match the This text needed
but one of them isn't matching.
` from the third line but not after that – Ena jaqis Mar 07 '19 at 08:39
\s*|?a>\s*)\K[\pL\s]+(?:(?=]*>)|$)~`](https://regex101.com/r/9SgJC2/3) – Эдуард Mar 07 '19 at 08:52