- or download this
use strict;
use warnings;
...
$str =~ s/"([^"]*)"/'"' . sort_and_reformat($1) . '"'/eg;
print $str, $/;
- or download this
$str =~ s/(?<=")([^"]*)(?=")/sort_and_reformat($1)/eg;
- or download this
$str =~ s/(?<=<tag refid=")([^"]*)(?=")/sort_and_reformat($1)/eg;