Improved Regex patterns a bit and made some style adjustments.