grep uses Posix Basic Regex (
BRE) by default which does not support your notation.
grep -E to use Posix Extended Regex (
grep -P to use Perl Compatible Regex (
PCRE) if available.
Your notation works with
grep -P '^\s+version:\s+(\d\.\d\.\d)' file.txt
This works with
grep '^ \+version: \+\([0-9]\.[0-9]\.[0-9]\)' file.txt
Note, that the capture group is not necessary here, as
grep doesn't do anything with it.
If you want the version nr only., use
grep -Po '^\s+version:\s+\K\d\.\d\.\d' file.txt
BRE, this is not possible, you will need to chain two
grep 'version: ' file.txt | grep -o '[0-9]\.[0-9]\.[0-9]'
sed (credits @Kusalananda):
sed -n 's/.*version: //p' file.txt