Improved regular expressions to avoid false positives.