You should always test your regexen, much like any other chunk of code. They’re at the most simple a function that takes a string and returns a bool, or returns an array of values. Here are some suggestions on what to think about when it comes to designing unit tests for regexen. These are not not hard and fast prescriptions for unit test design, but some guidelines to shape your thinking. As …
