Regular Expression Tips for People That Hate Regular Expressions

A screenshot of a code editor. There are three lines, setting the variables "isCustomerNumber", "isProductNumber" and "isTransactionNumber" based on whether a series of regular expression (regex) matches succeed

I’ve been writing regular expressions (regex) for years and would consider myself pretty good at them by now (I decline to provide references). The problem is that although it’s common to see regex as cryptic and painfully terse (which are not invalid points), they remain one of the best ways to handle complex pattern matching and as such you’ll probably run into them at least a few times in your career.

Even if you really despise writing regular expressions, here are some tips that will help to make that process as painless as possible!

Continue reading “Regular Expression Tips for People That Hate Regular Expressions”