Factor out the regex so it is clearer.