79

I was excited about a Hackathon... got there and the theme was REGEX! Just kill me already!

Comments
  • 7
    Easy! Just do a Cthulhu summoning ritual by parsing HTML with regex...

    Do it, and see the mass destruction happen before your eyes...
  • 3
    Just make a regex generator that spits out random junk until it works for what you want. What could go wrong?
  • 8
    You see that top row on your keyboard? Hold down shift, mash that row with your palm, and you now have a regex string, congrats!
  • 2
    I don't get all the hate regex gets. I find most people who hate regex never really understood how to write a regex properly.
  • 4
    RegEx are handy for two reasons,
    1. No more ugly string splitting to find stuff you want
    2. To win an ego battle with your technical lead.

    Seriously though, parsing log files is loads easier with RegEx
  • 3
    @deusprogrammer Pardon me, your highness!
    It is not about hating or not getting it! Regex is really useful and I get it... but for a Hackathon? Come on!
  • 0
    @thiagoavadore Sorry, I misunderstood you. I thought you were poo pooing regex.
  • 0
    @thiagoavadore our Hackathon is usually similar. But I mean, let's face it. A large part of hackathons is forensic work. And you can't tell me regex isn't useful for computer forensics.
  • 3
    @deusprogrammer, the problem with regex is that it's very hard to get. Something created to be a tool, to make things easier shouldn't be harder to tame that the spawn of Satan.
  • 0
    @Eariel but it's really not hard. Just out of curiosity, if you created a pattern matching syntax, what would you want it to look like? Like what would a pattern for a phone number look like in your pattern syntax :)?
  • 2
    @deusprogrammer Have you heard of parser combinators (like fastparse)? Regex is fine for simple strings, but it doesn't compose well and you shouldn't really use it for anything complex or it quickly gets hard to read.
  • 0
    @Esper I have not, but now I have something new to learn :P. Thanks Esper, I promise not to turn you into magicite to power my Magitek Armor now.
  • 2
    Oh and if one of you has to work with regex, you should give regex101.com a shot. If you turn the flags "global" and "multi-line" on, you can test a pattern against multiple different lines and see which match and what would be captured. Has saved me and my colleagues a ton of time.
  • 1
    @osmarks there are actually regex generators...
    found some while desperatly trying to get one to work.
    You give the webpage samples of input, mark what you need and it then generates a more or less usefull pattern.
    But my task was to complex or I to stupid for the website so I learned to do it myself.
  • 1
    @deusprogrammer, I wouldn't try to create a new one, I think. I don't like to reinvent wheels. Regex works. It's a nightmare with some cases, but you have already a lot of documentation and experts to ask about :) And there are libraries and such that help too.
  • 1
    Only one comment Email regex are nice... or not 😓
    http://regular-expressions.mobi/ema...
Add Comment