in reply to
How would I change a10 into A:10 in perl?
It can be done in one line:
$combined =~ s/(\w)(\d+)/uc($1) . ":$2" /e;
My proposed fix:
$combined =~ s/([a-z]+)(\d+)/\U$1:$2/i;
"If the requirements change from 1 letter to more, your code won't handle it. "
If the requirements change from letters to kanji or hiragana characters, *your code* won't handle it either. And that is just as likely.
Coding now to exceed the known requirements, in order to cater for some future, speculative change, is a waste of time and effort.
When (if!) the requirements change, the the code can be changed to match the new requirements.
I make decisions, and my brain carries them out
My brain makes the decisions, and I observe them (if I'm lucky)
I make some decisions, and my brain makes others
My spouse makes decisions and I and my brain carry them out
I wrote a program to relieve me and my brain from the burden of decision-making
The black-helicopter people project the decisions into my brain and then I do as ordered
Results (477 votes),