Fuck regex and everyone who has ever endorsed the use of and/or is affiliated with regex.
It's unreadable, impractical, overly complex and complicated and it adds unnecessary clutter to your code, and your thought process.
It's 00:50 am and I just spent 3 hours debugging a regex only to realise forgot a single "?" in a 75+ character long string and I want to go to bed.

  • 7
    I understand my friend. There are places on the internet for pre defined regex for all the common patterns. Check that out
  • 16
    U mad cuz u bad 😎😎

  • 12
    Regex is good for small matches but once its starts to grow you probably should split it (if the language permits is) into parts that you name to make it easier to understand and if that is not possible, add a lengthy comment detailing what it does.

    Listing every part with what it does makes it easier to spot that kind of errors but its still hard :/
  • 8
    I felt this way about regex before I took the time to understand it. Now I use it all over and love it's convenience!
  • 13
    Try regex101.com
  • 8
    Regex is goddamned brilliant. It's saved me untold hours.
  • 2
    I don't understand the hate for regex? It's great and powerful thing. Imagine validating form inputs without it.
  • 5
    @arcadesdude i always go to regex101 to create/mod my regex just to make sure my sanity is intact
  • 1
    You're right, I much prefer the concise readability of 15 nested if statements to check if an email is valid.
  • 2
    @Alkotronikk i used a double regex last week for highlighting search results. First to add \s* between each character but not beginning or end and second to find all instances of the patten in a term 😁 sounds super complicated but worked out very elegant
  • 1
  • 1
    Regex is great! I saved myself and other hundreds of hours with the help of it.
  • 2
Add Comment