I’m curious if how many of you are calling themselves experts when it comes to regex.. A while ago I was looking at a source code and didn’t understand what the hell is that? Then it came to me when I needed advanced finding and replacing, that THAT was regex. And the more advanced kind, hah. I’m just amazed of its power. I spent half of my yesterday studying it, now I can recognize and interpret some of the codes and formulas it uses, and I wrote a few easy ones. How long is the learning curve to be able to write it like plain english without much googling? Is it worth it? Is it possible? I can think of many many possible uses
It makes me think that if it’s even worth masking emails against bots like [at] this [.] huh?
You can learn the basics pretty fast.
.*? [this|that] (group) ^ $
^^ Learning this stuff can usually get you what you need.
Taking it to the next level to really understand how regex works to reduce backtracking and optimize for performance is another ballgame. I’ve been writing basic regex for a while now and I commonly run into the cryptic 100+ character regex that leaves me scratching my head. I’m not huge on comments but people should definitely explain what the hell is going on in some of these epic regex strings.
Regex is worth really knowing if you’re going to parse through alot of text on a regular basis. If not, the basics are good enough.
I commonly run into the cryptic 100+ character regex that leaves me scratching my head. I’m not huge on comments but people should definitely explain what the hell is going on in some of these epic regex strings.
Show me one. My head needs scratching.
How about this one for validating credit cards from http://www.regular-expressions.info/creditcard.html
It’s so powerful! Regex code highlighting sure helps.