Fixing regular expression comparison; adding tests