I am trying to replace a string with a part in it. It works in CYGWIN on Windows machine but when I try it in MAc it gives me error.
WIN RESULT (works):
$ cat lastVersion.txt
4.2.1.98/
$ sed -re 's/[0-9]+.[0-9]+.[0-9]+.([0-9]+).*/\1/' lastVersion.txt
98
MAC RESULT (does not work):
++ sed -e 's/[0-9]+.[0-9]+.[0-9]+.([0-9]+).*/\1/' lastVersion.txt
15:46:25 sed: 1: "s/[0-9]+.[0-9]+.[0-9] ...": \1 not defined in the RE
Any help? How can I make this work