thanks guys. i figured out the regex thing on my own. my parser is just recursive, using depth first search to parse the html or xml regardless of being wellformed or not. =)