Fixed Regex errors

Corrected and restructured regular expressions.