added first matching criteria for regex