cleaned up, regex support improved