Here's one solution.
local $_ = "A3xyz45M98AB7Z9"; s/(?<=\d)\B(?=\D)/:/g; print $_, $/;
Update: I see this is the same as the solution of Roy Johnson.
In reply to Re: Best way to put : between fields in a string
by ambrus
in thread Best way to put : between fields in a string
by eyepopslikeamosquito
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |