I have following string:
<ul>
<li>first</li>
</ul>
something
<ul>
<li>second</li>
</ul>
I want to match content of both <ul> tags, but not string between first opening <ul> tag from first list and closing </ul> tag from second string. How can I achieve that? Obvious choice for me was regular expression with negative lookahead, but it seems I can't create correct regexp. I've tried this: /<ul>([\s\S]+(?!<ul>))<\/ul>/gm, so "look for any character between <ul> and </ul> tags with one or more occurences, if it is not followed with <ul> characters", but it doesn't work. https://regex101.com/r/PbT1QA/1
([\s\S]+?(?!
– IT goldman Sep 16 '22 at 22:24))<\/ul>/`