• schnurrito@discuss.tchncs.de
    ·
    2 months ago

    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
    ·
    2 months ago

    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
    ·
    2 months ago

    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
    ·
    2 months ago

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