I have input data:

```
foo 24
foobar 5 bar
bar foo 125

```

and I'd like to have output:

```
foo 024
foobar 005 bar
bar foo 125

```

So I can use this sed substitutions:

```
s,\([a-z ]\+\)\([0-9]\)\([a-z ]*\),\100\2\3,
s,\([a-z ]\+\)\([0-9][0-9]\)\([a-z ]*\),\10\2\3,

```

But, can I make one substitution, that will do the same? Something like:

```
if (one digit) then two leading 0
elif (two digits) then one leading 0

```

Regards.