in reply to regular expression and nested tags

Another alternative is to use Html::TokeParser.