You could replace the lookbehind with a greedy `\K` ("keep left") assertion:
$ grep -oP '.*%28\K.*?(?=%29)' f.txt
NP_054520.1
You could replace the lookbehind with a greedy `\K` ("keep left") assertion:
$ grep -oP '.*%28\K.*?(?=%29)' f.txt
NP_054520.1