fork download
  1. #!/bin/bash
  2. s='width: 9%, width: 22%, width: 100%'
  3. perl -pe 's/width: (\d+)%/sprintf "width_%03s", $1/ge' <<< "$s"
Success #stdin #stdout 0.01s 5556KB
stdin
Standard input is empty
stdout
width_009, width_022, width_100