Clean up of regex patterns. Addition of a few comments.