Thursday, August 6, 2009

Regular Expressions Coaching

Try as I might, I've never had instant recall on the details of regular expressions. For whatever reason (infrequent use, old age) the syntax just slides out of my head and onto the floor mere minutes after using it.

Awhile back a co-worker introduced me to The Regex Coach, and I've used it regularly ever since. Paste in a snippet of text, type a regex pattern, and it highlights matches in the text as you type. Super easy way to (re)learn or explore regex.

It's targeted at Perl-style regex, which for me has proved completely compatible with Python's re module. If you like it, don't forget to donate.

A bonus tip for the regex-challenged like myself...
If you memorize only one thing: (.*)