I want to extract the version number from the ld -v command and I have written the following sed expression:
ld -v | sed -r 's/.+([0-9|\.]+)/\1/'
However this outputs 1, which is the last digit of the version number. The result I expect is 2.35.1
Where did I go wrong with my regular expression? How I understand it the .+ part matches all characters and whitespace and ([0-9|\.]+) matches a digit or a dot and then captures this. \1 then references the captured bit.