A workmate asked me today what is the best way to transform "A3xyz45M98AB7Z9" into "A3:xyz45:M98:AB7:Z9". I suggested:
and he seemed happy with that. In the spirit of TMTOWTDI how would you do it?my $s = 'A3xyz45M98AB7Z9'; my $t = join(':', $s =~ /[A-Za-z]+\d+/g); print "s='$s' t='$t'\n";
In reply to Best way to put : between fields in a string by eyepopslikeamosquito
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |