I am trying to extract the version of a `jdk` using `regular-expressions` Actually I have the following version:

```
openjdk 11.0.9.1 2020-11-04
OpenJDK Runtime Environment (build 11.0.9.1+1-Ubuntu-0ubuntu1.18.04)
OpenJDK 64-Bit Server VM (build 11.0.9.1+1-Ubuntu-0ubuntu1.18.04, mixed mode,sharing)

```

I wrote the regex. It looks like the following:
`^[0-9]{1,2}\.[0-9]{1,2}\.[0-9]{1,2}\.[0-9]{1,2}$`

**This regular expression is working on the online regex tester** (<https://regex101.com/>). Unfortunately, **it is not working with grep-command. I am using the extended regular expression**. My Code for the extraction of jdk-version look like the following:

```
CMD_RESULT=$(java --version 2>&1 | head -n 1 | cut -d '' -f 2)
if [ ! -z "$CMD_RESULT" ]
then 
    for token in $CMD_RESULT
    do
       JAVA_VERSION=$(echo $token |  grep -e $VERSION_EXTRACTION_REGEX)
       if [ ! -z  $JAVA_VERSION ];
       then
            printf "${GREEN}Java version: [$JAVA_VERSION]\n"
       fi
     done
fi

```

I am not understanding, why my regex is working on the online regex checker, while it is not working with the grep-command. I am using the Parameter -e for extended regexp.

Any Idea ?