Very true. I plan on writing about those in a coming post, along with zero-widths and look aheads/behinds. It has been a challenge trying to distill such a powerful tool into its logical building blocks, without biting off too much in any individual post.
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?
Regex as a language kind of sucks. If you don't use it on a daily basis, it's pretty easy to let your understandability of it slip to the point where the average regex looks like symbol soup. At the cost of terseness, I think representing regexes as a chain of operations would be much more practical. I've seen at least one library do this on HN probably a couple years back, and it was roundly derided in the comments.
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.
I acquired a dislike of regexes in school, and it wasn't until I found http://www.regexr.com that I felt I could efficiently figure out how to use them (and started to feel that they were seriously awesome). I think that regexes, like so many programming tools/utilities, have such a frustrating initial learning period that many people don't want to bother.
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.
If people don't want to learn it, it won't happen.
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.
The most luck I had with this was tackling a massive problem with something elegant then offering the idea of regular expressions when a similar problem came up for my colleagues.
i used to try this, but young programmers especially tend to just leave thinking "regex is so powerful but i don't know it", which was likely their mindset going in anyway.
http://www.regular-expressions.info/named.html