in reply to How would I change a10 into A:10 in perl?

May be something like this:
$a = "a10, b10, C10"; $a =~ s/([a-z])([0-9]+)/\u\1\:\2/g; print "$a\n";

UPDATE: Already shown by other monks!

Replies are listed 'Best First'.
Re^2: How would I change a10 into A:10 in perl?
by GrandFather (Saint) on Dec 03, 2010 at 03:01 UTC

    As the the warnings would have told you if you'd have tried running your code with strictures:

    \1 better written as $1 at ... \2 better written as $2 at ...
    True laziness is hard work
      \1 and \2 are not stricture errors (use strict does not generate warnings - they are fatal errors). They are warnings, and require warnings to be turned on.