There was done a lot for the search part in the recent nala releases.
Version 0.12.0 fixed the end-of-text RegEx search pattern:
Search end-of-text regexp not finding matches
So if you update to this version or later, the query returns the expected results (here done for apt):
$ nala search -n ^apt$
apt 2.4.8 [Ubuntu/jammy main]
├── is installed
└── commandline package manager
For packages in the universe repository, make sure this is enabled, to be able to find packages included here. You then get the expected result for gimp as well:
$ nala search -n ^gimp$
gimp 2.10.30-1build1 [Ubuntu/jammy universe]
└── GNU Image Manipulation Program
For the RegEx explained, the character ^ indicates the beginning of the line and $ indicates the end of the line.
- The search
^something$ will return something only.
- The search
^something will return all matches that begin with something
- The search
something$ will return all matches that end with something