Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Increment a string with letters and numbers

by hdb (Parson)
on Mar 28, 2013 at 09:00 UTC ( #1025909=note: print w/ replies, xml ) Need Help??


in reply to Increment a string with letters and numbers

More or less same procedure as yours but in one expression. Probably not much of an improvement...

while(<DATA>) { s/(\D+)(0*)(\d+)/sprintf("%s%07d",$1,$3+1)/e; print; } __DATA__ EVO:0000023 EVO:0000099 EVO:0010099 EVO:9999999


Comment on Re: Increment a string with letters and numbers
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1025909]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (8)
As of 2014-07-30 11:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (230 votes), past polls