Q:

Add a suffix to a matched regular expression

I got some lines containing numbers in the first field:
46066.874.89
48569.123.56
56489.256.88
654.12.32
84689.25.69

What I would like to do now is add 00 at the end of 654 in the fourth line and every other occurrence of three numbers in the file before the first .. How would I go about it?  I tried using
sed 's/^[0-9][0-9][0-9]./&00/'

but the output I get is
4606006.874.89
4856009.123.56
5648009.256.88
654.0012.32
8468009.25.69

A:

You're almost there:
$ sed -E 's/^([0-9][0-9][0-9])\./\100./' file 
46066.874.89
48569.123.56
56489.256.88
65400.12.32
84689.25.69

