Firstly, you should use code tags and not PHP tags.
I'm not quite certain whether you would like to show the entire line that contains .1
in the third field or just the contents of the third field that contains .1
In either case, you regex ".1$"
means to find any line that ends (the $) with any character (the .) followed by a 1. Since the .
is a regex meta-character, it must be escaped if you to include it as part of your regex. So it's strange that grep would return any lines with the regex given.
To list any line that contains a .1
grep "\.1" < /path/to/file
If you need to return just the third field you will need to use SED or AWK. Even a simple cut can work (assuming your field delimiter is a tab):
grep "\.1" < /path/to/table | cut -f3
Hope it helps.