in reply to Re^5: How to convert a string with regex to a string with a fixed length?
in thread How to convert a string with regex to a string with a fixed length?
Update: that's what I get for not reading the OP carefully... how about (and being slow...oh well):s/(\d+)/sprintf("%013d", $1)/eg
s/(\d+)/reverse(sprintf("%013d", scalar(reverse($1))))/eg;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^7: How to convert a string with regex to a string with a fixed length?
by MidLifeXis (Monsignor) on Jul 29, 2008 at 17:09 UTC |