18
Asbetha
5y

So I have to fix this motherfucking insane regex with over 1k chars in it ...
This fucking shit is not maintainable and there are no comments or any other sort of documentation.
And this bullshit was not build via code so that bastard wasted weeks of time to develop that shitty expression by hand on a online regex tester website.

So I have 3 options:
1. Reverse engineer everything and waste my precious time
2. Delete that shit, analyze the input and write the regex via code instead of creating it by hand
3. Look for that "super duper clever" dev and break his legs.

I think option 3 suits me best.

And for you dear reader, if you are regexphile, enjoy this gigantc regex with >16k chars:
http://madore.org/~david/weblog/...

Comments
  • 4
    grep was made in the 70ties to search and replace small typos in multiple documents at once.
    your abomination of a query is clearly abuse and a crime and should reported to DevPolice!

    so do 3 and 2
  • 4
    Write unit tests. A lot of them. Then refactor.

    Here's a VERY good tip on how to do it: https://youtube.com/watch/...

    Edit: By the way, if the language supports, make sure to use the /x flag and split the regex into separate lines.
  • 3
    Man yall should've just used UUID's when yall had the chance :v

    Well I'm guessing it's some kind of ID since it's just a bunch of "this number or this number"s
  • 3
    wtf.. who the hell uses regex 1000 characters and for what?
  • 0
    Id suggest to break his fingers so he may not write such abominations ever again!
  • 0
    @Pyjong People who don't plan for the future. Or people who use Perl a lot.
  • 0
    I've been through similar shit. Option 3 any day man. Fuck it.. I'll help you break his legs
Add Comment