Can someone make the awk
line below work in awk please. The syntax uses the standard PCRE regex standard (and i need to expect that some non-numeric characters are preceded to the first number, that is the string can look like "++3.59 ± 0.04* "
). (note that I tried [0-9]
and [:digit:]
instead of \d
) also note that I did read https://www.gnu.org/software/gawk/manual/gawk.html#Regexp
gawk 'BEGIN{test="3.59 ± 0.04";match(test, /^.*?(\d+?\.\d+?)\s*?±\s*?(\d+?\.\d+?)$/, arr);print arr[1];}'