Ask HN: How did you get good at regexes? - mav3rick
======
karmakaze
I don't really understand the question. Writing regexes seems fairly straight-
forward to me, as in I just do the first thing I think of most of the time.

This makes me think I'm in the 'not good at regexes' group. The most advanced
things I use are multiline, non-capturing, non-greedy modifiers and back-
references in the pattern or replacement. If it goes beyond that I parse.

Anyone mind posting some more advanced usages that come up?

------
tomohawk
Play regex golf: [https://alf.nu/RegexGolf](https://alf.nu/RegexGolf)

Since many people are not good at them, whenever I use a regex in code, I add
a comment with at least one example of the text that is to be matched, and
note what the regex is also attempting to avoid. This is also a learning
activity.

There is also the "Mastering Regular Expressions" book.

------
yati
I used to work at a Perl shop. The language makes it so easy to use regexes
that you risk abusing them, but nevertheless that exposure has helped me
become quite proficient with regexes. I use Perl one liners whenever I need to
deal with text data on the command line, so that keeps me exposed to regexes.

