in reply to Regex / "Sophisticated" End of Line

You were almost there. This works:

$ perl -wE 'while (<>) {if (m{ \A \S+ \s+ \S+ \s+ Homo \s+ sapiens .*? + ([NX] \S+) \s+ \S+ \s+ \z }msx) {say $1}}' < 867580.dat NP_001120800.1425 NP_000009.1655 NP_000023.2587

There's some whitespace at the end of the lines so your final \S+$ wasn't matching.

-- Ken