I seriously find regular expressions a boring area in programming. I sometimes think people who write good regular expressions have some kind of super powers. Am I alone here? 😐
For further actions, you may consider blocking this person and/or reporting abuse
Oldest comments (25)
Not alone. I rarely turn to Regex unless it's the absolute obvious choice or it's the existing pattern in the code I'm modifying (and even then, sometimes there's a reason to remove it).
That being said, regex can be the underlying implementation of friendlier interfaces.
What do you use in place of regex?
You can implement a
replaceAllfunction forStrings just using the built-inreplaceand regex:Not alone for sure. I don’t see anything “regular” in regular expressions and getting one that works can be very tough indeed. And don’t even get me started on flags haha
😂😂😂
I tend to avoid them. Not because I dont understand them(I believe I am above average there), but because I find them easy to lead me to dirty errors.
Usually there is a better alternative around the API of the language.
so give it a hard try but dont take it personally
APIs, I'll research more on that.
Yes we do have super powers. However, you do not have to get bitten by a radio active spider. Start small, and grow into larger expressions.
But, regex are no substitute to writing a proper parser. It is basically a rather powerful kludge.
Would you like to know more?
Thanks for the blog post link. Gives some useful tips on how to deal with this monster
Do you watch the silicon valley series? I'm asking because of your last name. Hendriks
Yes I do watch it. We're not related, I for one actually exist :p
lol. But you can try and build the "new internet".
You are not alone, at all, however, I have found regular expressions to be incredibly powerful and extremely useful, it is always a good thing to know, or at least understand.
p.s. We do have super powers ;)
The importance and usefulness of regular expressions cannot be stressed enough. However, writing them can be daunting.
I find daunting to be fun. 😝
I love to write regular expressions, unfortunately I don't have enough occasions to use them in web development aside from form validation...
Yeah, I also mostly use it for validation.
You must really be in love with regex
Hey, for better understanding and possibly more interesting learning process you can try such service like regexone.com/
This service helps you learn regular expressions with interesting tasks which you can solve by multiple ways :)
You're certainly not alone.
I actually do really enjoy regular expressions. It's one of the few things I can mentally dive into and not "come up for air" for hours. However, based on the developers I've met, I am in a very small minority.
I love it. Usually I use in an text editor to create or modify large amounts of text. Sometimes I create sequences in Excel (yep, Excel) and then apply RegExes to it to build some JSON out of it. I rarely use it in production code, because readability and maintainability is much more important than short code.
Just today, we refactored a 3 line regEx to about 100 lines of code which is longer but much more comprehensible.