in reply to Re^3: 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?

The scanner gives me the original scanned barcode without changing anything. But no errors at all. Is your solution s/\b(\d+)\b/reverse sprintf "%013d", scalar reverse $1/eg; a real regex? or has it already some extra program-lines? (like sprintf...)
  • Comment on Re^4: How to convert a string with regex to a string with a fixed length?

Replies are listed 'Best First'.
Re^5: How to convert a string with regex to a string with a fixed length?
by moritz (Cardinal) on Jul 29, 2008 at 16:59 UTC
    It's a substitution, which contains a regex.

    As you've been told multiple times in the chatterbox, a regex can't change a string, it just either matches or it does not. So your project to modify a string with a regex is pretty much doomed.

    I suspect that it's either not possible in your setup, or you missed some small but important detail in the documentation.