Improved regex and removed obsolete trim