Simplified some regular expressions
Removed old version of the script