my $re = qr/(match|matching\.com|match.company)/i; print "old - $1\n" if "matching.com" =~ $re; $re = qr/(matching\.com|match.company|match)/i; print "new - $1\n" if "matching.com" =~ $re; __output__ old - match new - matching.com