Sub Main ()
html = "<h1>First Header</h1><div><h11>Blah<h1>Second Header</h1></h11><h1>Third Header</h1><h2>H2 Header<h2>"
list = 
re = CreateObject ("roRegex", ".*?<h1>(.*?)</h1>(.*)", "is")
ma = re.Match (html)
While ma.Count () > 2
list.Push (ma )
ma = re.Match (ma )
Why don't you just give it the XML treatment with roXmlElemnet.parse()? And then walk the tree as if it were XML.
That will work with many HTMLs and even the remaining ones, most can be pre-patched for issues before a xml-parse.
Sorry for commenting on such an old post
Without knowing what the parse is failing on how would I know what to pre-patch?