my @delim = (",", ";", ":", "\t"); my $line = "This;is;delimited;with;a;semicolon,;and;there;is;a;comma"; for ( @delim ) { print "possibly delimited with $_\n" if $line =~ /([^$_]+$_){2,}/; } # prints "possibly delimited with ;"