I'm still pretty new to regex and I have this string:
Client Version: openshift-clients-4.3.0-201910250623-88-g6a937dfe Server Version: 4.3.0 Kubernetes Version: v1.16.2:q
And I wanted to grab 4.3.0
, which is between Server Version:
and Kubernetes
I thought I could do something like: (\d*\.?\d+\.\d)
, which grabs every decimal number that has a length of 3, but I just want it to return a single number.
So I tried (Server Version: )+(\d*\.?\d+\.\d)
but this gives me 2 capture groups and I want to store the number 4.3.0 in a variable
I'm playing around here
Wanted to use this regex with grep
or sed
Any help is appreciated!