Improvements to regex.