c:\@Work\Perl>perl -wMstrict -e "my $s = 'aXbYcZd'; print qq{'$s' \n}; ;; print qq{unhandled sequence: '$s' \n} if $s =~ s{ ([XYZ]) }{ sprintf '[%d/%1$#X/%1$#o]', ord $1 }xmsge; " 'aXbYcZd' unhandled sequence: 'a[88/0X58/0130]b[89/0X59/0131]c[90/0X5A/0132]d'