Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Easy! Just do a Cthulhu summoning ritual by parsing HTML with regex...
Do it, and see the mass destruction happen before your eyes... -
osmarks8668yJust make a regex generator that spits out random junk until it works for what you want. What could go wrong?
-
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!
-
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.
-
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 -
@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! -
@thiagoavadore Sorry, I misunderstood you. I thought you were poo pooing regex.
-
@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.
-
Eariel19068y@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.
-
@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 :)?
-
Esper938y@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.
-
@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.
-
Esper938yOh 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.
-
Falk3118y@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. -
Eariel19068y@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.
-
RenCloud248yOnly one comment Email regex are nice... or not 😓
http://regular-expressions.mobi/ema...
I was excited about a Hackathon... got there and the theme was REGEX! Just kill me already!
undefined