use Regex::PreSuf; print presuf("1234", "ABCD", "HIGL", "TOOA", "COOLIE"); __output__ (?:1234|ABCD|COOLIE|HIGL|TOOA)