use re.search instead of if in