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
-
Voxera115858yRegexis good for some problems, but once the regex starts to grow and most parts is not real words you look for in a string (like filtering lines from a log) you really should start to question if it's the right tool.
Once regex get complicated enough they start being a problem since they get hard to follow and can display strange edge cases that are non obvious.
By that time some other parsing might be better. Or just split it into several separate regex, one for finding possible rows, one for sorting out the wrong once and finally one for extracting out info instead of one doing all three. -
@stackodev Nah, that title is reserved to bit shifting. Regex's at least still have letters...
-
AptFox1088y@stackodev agreed but when it works and saves you a bunch of lines of code, dear God does it feel good.
-
0c370t1018yI usually find that the quickest, easiest way to build a regex is with lots of little regexs
-
@Voxera as long as you use the modifier that ignores white space it makes it much easier to keep everything straight on long complicated expressions. Then you can use newlines and white space to make it all nifty.
Related Rants
-
RandomQuote6"Measuring programming progress by lines of code is like measuring aircraft building progress by weight." - Bi...
-
RandomQuote10"Programming today is a race between software engineers striving to build bigger and better idiot-proof progra...
-
RandomQuote31"If Java had true garbage collection, most programs would delete themselves upon execution." - Robert Sewell
"Some people, when confronted with a problem, think “I know, I’ll use regular expressions.” Now they have two problems." - Jamie Zawinski
undefined
random quote