reverse sort keys %trI'd probably sort them by negative length and join them to a single regex:
my $regex = '(' . join('|', sort { length $b <=> length $a } keys %tr) . ')'; $str =~ s=$regex=$tr{$1} // $1=ge;
In reply to Re^5: Human-readable date format strings
by choroba
in thread Human-readable date format strings
by thewebsi
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |