Understanding Regular Expressions 2: Groups and Captures
blog.benroux.me
blog.benroux.me
I often find people absolutely baffled, and at the same time amazed at regular expressions. I am, of course, referring to my coworkers, whom I try to convince to at least attempt at using regular expressions. Unfortunately, no matter how many cheat-sheets I print and handout, or how many times I wow them with simple yet powerful regular expressions, they resort to using the proverbial brute-force hammer that they know.
Has anyone had any positive luck with convincing/converting coworkers into using more regular expressions?
But failing adoption of such a library, there's not a whole lot of excuse for a professional programmer not to be able to look up some syntax to whip up a regex in cases where it's the right tool for the job.
Regexr sidesteps this by not only having hints/cheat sheets on the side, but it shows you your results as you construct it; faster feedback = faster learning.
With that being said, I found the introduction to regular expressions in Speech and Language Processing, by Daniel Jurafsky to be the only one where it clicked for me what was going on.
aversion to regex is like aversion to SQL. sometimes declarative saves literally hundreds of lines of hard-to-understand, poorly optimized code.