1685 posts Time is what you desire most, but waste carelessly.
  • Sold between 100 000 and 250 000 dollars
  • Elite Author
  • Bought between 50 and 99 items
  • Referred between 100 and 199 users
  • Grew a moustache for the Envato Movember competition
  • Exclusive Author
  • Has been a member for 4-5 years
  • Envato Studio (Microlancer) Beta Tester
  • Europe
+1 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
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 3-4 years
  • Sold between 100 and 1 000 dollars
  • United States
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
  • Author had a File in an Envato Bundle
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 5-6 years
  • Sold between 1 000 and 5 000 dollars
  • United States
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.

1685 posts Time is what you desire most, but waste carelessly.
  • Sold between 100 000 and 250 000 dollars
  • Elite Author
  • Bought between 50 and 99 items
  • Referred between 100 and 199 users
  • Grew a moustache for the Envato Movember competition
  • Exclusive Author
  • Has been a member for 4-5 years
  • Envato Studio (Microlancer) Beta Tester
  • Europe
+1 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
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 3-4 years
  • Sold between 100 and 1 000 dollars
  • United States
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
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 3-4 years
  • Sold between 100 and 1 000 dollars
  • United States
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 :(

1685 posts Time is what you desire most, but waste carelessly.
  • Sold between 100 000 and 250 000 dollars
  • Elite Author
  • Bought between 50 and 99 items
  • Referred between 100 and 199 users
  • Grew a moustache for the Envato Movember competition
  • Exclusive Author
  • Has been a member for 4-5 years
  • Envato Studio (Microlancer) Beta Tester
  • Europe
+1 more
Firsh says

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

by
by
by
by
by
by