in reply to Find common prefix from a list of strings
@files = qw(model4run1 model2run1 model4run2 model); $reg = ' \\1[^ ]*' x $#files; "@files" =~ /^([^ ]*)[^ ]*$reg$/; print $1; [download]