• schnurrito@discuss.tchncs.de
    ·
    7 天前

    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.

  • communism@lemmy.ml
    ·
    7 天前

    OP isn't trying to parse HTML though.... they are trying to detect opening xml tags. Which seems quite achievable with regex.

  • OpenStars@startrek.website
    ·
    7 天前

    Calendar, remind me to ask StackOverflow tomorrow if I can parse HTML with regexs get someone else to do my class homework for me?

    TH̘Ë͖́̉ ͠P̯͍̭O̚​N̐Y̡ H̸̡̪̯ͨ͊̽̅̾̎Ȩ̬̩̾͛ͪ̈́̀́͘ ̶̧̨̱̹̭̯ͧ̾ͬC̷̙̲̝͖ͭ̏ͥͮ͟Oͮ͏̮̪̝͍M̲̖͊̒ͪͩͬ̚̚͜Ȇ̴̟̟͙̞ͩ͌͝S̨̥̫͎̭ͯ̿̔̀ͅ

    Sweet, my summoning spell worked!

  • orcrist@lemm.ee
    ·
    6 天前

    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. :-)