no, this is one of the worst answers on Stack Overflow
OP had a specific question to capture opening tags. The thing OP asked about can be done with regular expressions. It is true that arbitrarily nested languages like HTML cannot generally be parsed with regular expressions, but that is not what OP asked about.
OP isn't trying to parse HTML though.... they are trying to detect opening xml tags. Which seems quite achievable with regex.
Calendar, remind me to ask StackOverflow tomorrow if I can
parse HTML with regexsget someone else to do my class homework for me?TH̘Ë͖́̉ ͠P̯͍̭O̚N̐Y̡ H̸̡̪̯ͨ͊̽̅̾̎Ȩ̬̩̾͛ͪ̈́̀́͘ ̶̧̨̱̹̭̯ͧ̾ͬC̷̙̲̝͖ͭ̏ͥͮ͟Oͮ͏̮̪̝͍M̲̖͊̒ͪͩͬ̚̚͜Ȇ̴̟̟͙̞ͩ͌͝S̨̥̫͎̭ͯ̿̔̀ͅ
Sweet, my summoning spell worked!
I'm not a professional code monkey although I've done a fair amount of coding, and every time I tried to do parsing myself, I later regretted it.
But telling people that they're doing it wrong is rarely met with positivity. :-)