in reply to RE: Re: Why regular expression so hard?!
in thread Why regular expression so hard?!
That picks up numbers at the end of the line. If you want the last number in the line (ignoring possible trailing text) throw in \D* before the $.perl -ne 'if (/(\d+(\.\d+)?)$/) {print $1, "\n"}' file1 file2
|
|---|