News for hackers. Stuff that matters.
Re:Show HN: Regex Cheatsheet by justaj on Friday January 31, 2020 @12:14PM (#22203374)
Honestly, as a noob, this is one of the biggest reasons I have such a hard time deciding to learn regex.

Python flavor would probably be different than PCRE, which is probably different than JS flavor.

Even worse is that it might be too late to standardize all the regex flavors because there is already so much written in different regex flavors that it just costs too much for them to become obsolete in the future.

This is really demotivating.

Re:Show HN: Regex Cheatsheet by chirss on Friday January 31, 2020 @12:33PM (#22203571)
Honestly don't let this get you down, here's a learning plan (use regex101 to learn)

1) Learn PCRE regex. 2) Try regex golf or cross words to learn PCRE regex. 3) Take the quiz on regex101.

Once you're done with all 3:

Learn the minor/major differences in the other languages. There aren't many. For example this named capture group:

(?<somename>someregex)

Would look like this in a different language:

(?P<somename>someregex)

There's some differences about what language can and cannot do like recursion because someone thought it was a great idea to make javascript awful at regex, but that's besides the point. Regex is totally worth learning.

Re:Show HN: Regex Cheatsheet by new_guy on Friday January 31, 2020 @02:57PM (#22204996)
> Honestly, as a noob, this is one of the biggest reasons I have such a hard time deciding to learn regex.

Clear your afternoon, and just learn it. Seriously, it takes a couple of hours at best and then - BOOM - you're done for the rest of your life.

Re:Show HN: Regex Cheatsheet by absorber on Friday January 31, 2020 @03:54PM (#22205605)
> you're done for the rest of your life.

If that were so easy then I don't think much of these cheatsheets would exist.

Re:Show HN: Regex Cheatsheet by freehunter on Saturday February 01, 2020 @07:15PM (#22214213)
The cheat sheets exist because people aren’t learning regex. You don’t need to learn every flavor of regex, just the one or small number you need to know. And once you know the basics, the differences are very minor.
Re:Show HN: Regex Cheatsheet by quickthrower2 on Saturday February 01, 2020 @06:33AM (#22209995)
The basic regex is easy, infact an English word is a regex! A dot matches a single character. Star multiple of the previous character. Just that is useful for a lot of cases!
Re:Show HN: Regex Cheatsheet by olskool on Friday January 31, 2020 @08:39PM (#22207912)
If you believe it is possible to become an expert in regular expressions as they exist in modern computer languages in "a couple of hours at best" you are delusional.
Re:Show HN: Regex Cheatsheet by doliveira on Saturday February 01, 2020 @04:58AM (#22209703)
He didn't say you could become an expert in a single afternoon.