Assign numbers with decimals from a line to a variable

I am trying to assign a string of numbers with their decimals to a variable. The code reads a file called 'log'. I have not included the entire file since it's huge.

The line is:

 Tagging release with the label program-2.8.114...

My code:

BUILDNUMFORSIT=$(egrep 'Tagging release with the label program-' log | grep '[0-9]\{1,\}.[0-9]\{1,\}.[0-9]\{1,\}')

My output:

BUILDNUMFORSIT=' Tagging release with the label program-2.8.114...'

My desired output:

BUILDNUMFORSIT=2.8.114

Please help!:mad:

one way: substitute the last

| grep '[0-9]\{1,\}.[0-9]\{1,\}.[0-9]\{1,\}'

for

| awk -F '-' '{while(sub("\.$","",$2)){} ; print $2 }'
awk -F"-" '/Tagging release with the label program/ { print substr($NF,1,7); } ' log_file

or

| sed 's/.*\-\(.*\)\.\{3,\}$/\1/'