join "|", map quotemeta, sort { length $b <=> length $a } keys %dict;