1717 posts Time is what you desire most, but waste carelessly.
  • Has sold $125,000+ on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has been part of the Envato Community for over 4 years
  • Sells items exclusively on Envato Market
+6 more
Firsh says

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? :D 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? :)

20 posts
  • Has been part of the Envato Community for over 4 years
  • Has sold $100+ on Envato Market
  • Has collected 1+ items on Envato Market
  • Sells items exclusively on Envato Market
+1 more
Duilen says

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.

320 posts
  • Has been part of the Envato Community for over 5 years
  • Has sold $1,000+ on Envato Market
  • Had an item featured in an Envato Bundle
  • Has collected 1+ items on Envato Market
+2 more
jwmcpeak says

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.

1717 posts Time is what you desire most, but waste carelessly.
  • Has sold $125,000+ on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has been part of the Envato Community for over 4 years
  • Sells items exclusively on Envato Market
+6 more
Firsh says
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.

:D Show me one. My head needs scratching.

20 posts
  • Has been part of the Envato Community for over 4 years
  • Has sold $100+ on Envato Market
  • Has collected 1+ items on Envato Market
  • Sells items exclusively on Envato Market
+1 more
Duilen says

How about this one for validating credit cards from http://www.regular-expressions.info/creditcard.html

^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|6(?:011|5[0-9][0-9])[0-9]{12}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\d{3})\d{11})$
20 posts
  • Has been part of the Envato Community for over 4 years
  • Has sold $100+ on Envato Market
  • Has collected 1+ items on Envato Market
  • Sells items exclusively on Envato Market
+1 more
Duilen says

I believe there are some pretty good examples in the regex section of ‘High Performance Javascript’ by Nicholas C. Zakas but I’ve apparently misplaced my copy :(

1717 posts Time is what you desire most, but waste carelessly.
  • Has sold $125,000+ on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has been part of the Envato Community for over 4 years
  • Sells items exclusively on Envato Market
+6 more
Firsh says

It’s so powerful! :D Regex code highlighting sure helps.

by
by
by
by
by
by