Skip to content
DevMeme
3115 of 7590
Bugs Post #3434 · source on Telegram

Regular Expressions: Turning One Problem into Two

Description

A classic three-panel black-and-white comic strip from the webcomic xkcd, featuring two stick figures. In the first panel, one stick figure wearing sunglasses says to the other, 'I GOT 99 PROBLEMS,'. In the second panel, the conversation continues with the same character explaining, 'SO I USED REGULAR EXPRESSIONS.'. In the final panel, the character delivers the punchline: 'NOW I HAVE 100 PROBLEMS.'. This comic perfectly encapsulates a universal and painful experience for software developers. It's a humorous take on the famous quote by Jamie Zawinski: 'Some people, when confronted with a problem, think ‘I know, I’ll use regular expressions.’ Now they have two problems.' While regex is an incredibly powerful tool for pattern matching and text manipulation, its complex, often cryptic syntax can lead to solutions that are difficult to read, debug, and maintain, effectively creating a new, more complicated problem than the one it was meant to solve

Comments

23
Anonymous ★ Top Pick My favorite part of using regex is the follow-up task six months later, titled 'Figure out if it's cheaper to reverse-engineer this regex or just rewrite the entire application.'
  1. Anonymous ★ Top Pick

    My favorite part of using regex is the follow-up task six months later, titled 'Figure out if it's cheaper to reverse-engineer this regex or just rewrite the entire application.'

  2. Anonymous

    Regex: the only tool that lets you upgrade an off-by-one bug to exponential-time catastrophic backtracking - and call it a hotfix

  3. Anonymous

    After 20 years in the industry, I've learned that regex is like a distributed system - it works perfectly until someone asks you to explain why it works, then you realize you've been cargo-culting the same Stack Overflow answer since 2009 and praying the edge cases never show up in production

  4. Anonymous

    This perfectly captures the moment when a senior engineer confidently reaches for regex to solve a string parsing problem, only to spend the next three hours debugging catastrophic backtracking, Unicode edge cases, and that one test case where someone put a newline in their email address. The real problem isn't the 100 problems - it's explaining to the PM why the 'simple text validation' ticket is now in its third sprint

  5. Anonymous

    Regex: where 'simple match' backtracks into a state explosion that'd make CAP theorem jealous

  6. Anonymous

    Ship a one‑line regex to prod and you’ve deployed an NFA with a 2 a.m. SLA

  7. Anonymous

    Had 99 problems; used PCRE - now we have catastrophic backtracking, Unicode edge cases, and a RE2 migration. Call it an even 100

  8. @alhimik45 5y

    but still need 28 problems to get round number 😉

  9. @XR443 5y

    I got 99 problems, but RegExp ain't one

  10. @VlP_AI_TG 5y

    Мем говно (Cool meme)

    1. @sylfn 5y

      thats not how translations work

      1. @pavloalpha 5y

        Ты долбоеб(You're a cool man bruh❤️). Just joke, don't be serious)

    2. @azizhakberdiev 5y

      Следи за базаром, because some understand russian

      1. @sylfn 5y

        So do I -- I'm Russian

  11. @nuntikov 5y

    Админ петучь That's a great meme, really funny

    1. @azizhakberdiev 5y

      I think admin is russian too, his name is east european

  12. @saidov 5y

    This channel reminds me of Orwell’s Animal Farm, but instead of communists, there are Russians

  13. @ZgGPuo8dZef58K6hxxGVj3Z2 5y

    I have to admit I never used regex but doesn't look that hard

    1. @RiedleroD 5y

      it isn't hard

      1. @ZgGPuo8dZef58K6hxxGVj3Z2 5y

        Lol then why are there that many memes about it?

        1. @RiedleroD 5y

          well, it looks hard if you don't know how it works. Just like svg paths btw, they're also really simple.

          1. @ZgGPuo8dZef58K6hxxGVj3Z2 5y

            Oh okay

  14. @Ra_zor 5y

    Now I have \d+ problems?

Use J and K for navigation