Currently, emerge --search only uses regular expressions when the search string in prefixed with %. It might make sense to enable this behavior automatically if the search string contains special characters like ^ or $.
Bug 10651 shows that regular expressions where enabled by default at some point in the past. If we enable regular expression support automatically, then we need it to behave well if the expression fails to compile.
Patch posted for review: https://archives.gentoo.org/gentoo-portage-dev/message/b32949918017308491eabc69f46f5810 https://github.com/gentoo/portage/pull/612
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/proj/portage.git/commit/?id=03ae0d95797f68cf86748ae3da184f3018e8c64c commit 03ae0d95797f68cf86748ae3da184f3018e8c64c Author: Zac Medico <zmedico@gentoo.org> AuthorDate: 2020-09-01 02:49:50 +0000 Commit: Zac Medico <zmedico@gentoo.org> CommitDate: 2020-09-08 00:17:54 +0000 emerge --search: auto-detect regular expressions (bug 737480) Automatically detect regular expressions when the search string contains any of these regular expression characters or character sequences: ^ $ * [ ] { } | ? .+ This simplifies usage, so that users no longer have to remember to prefix regular expressions with the % character. The new behavior can be disabled by --regex-search-auto=n, in case the regular expressions interpretation causes some kind of problem. Note that fuzzy search and regular expression search are mutually exclusive, and fuzzy search remains the default for search strings that do not contain any regular expression characters. Bug: https://bugs.gentoo.org/737480 Signed-off-by: Zac Medico <zmedico@gentoo.org> lib/_emerge/actions.py | 1 + lib/_emerge/main.py | 6 ++++++ lib/_emerge/search.py | 12 +++++++++++- man/emerge.1 | 12 +++++++++++- 4 files changed, 29 insertions(+), 2 deletions(-)
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fd840baeef963f5fe746f9167976ce0eed83a3b4 commit fd840baeef963f5fe746f9167976ce0eed83a3b4 Author: Zac Medico <zmedico@gentoo.org> AuthorDate: 2020-09-08 03:44:51 +0000 Commit: Zac Medico <zmedico@gentoo.org> CommitDate: 2020-09-08 03:51:23 +0000 sys-apps/portage: Bump to version 3.0.6 #668302 binrepos.conf: support fetchcommand customization #668334 Add binrepos.conf to replace PORTAGE_BINHOST #704416 env-update: create systemd user-session environment #737470 egencache --update-pkg-desc: emulate esync --verbose #737480 emerge --search: auto-detect regular expressions #739908 @change-deps: fix erroneous repeated rebuilds #740588 make.conf: Treat __* variables as local #740898 PORTAGE_BINHOST urlopen proxy support #740904 rsync and gemato proxy support Bug: https://bugs.gentoo.org/739718 Bug: https://bugs.gentoo.org/668302 Bug: https://bugs.gentoo.org/668334 Bug: https://bugs.gentoo.org/704416 Bug: https://bugs.gentoo.org/737470 Bug: https://bugs.gentoo.org/737480 Bug: https://bugs.gentoo.org/739908 Bug: https://bugs.gentoo.org/740588 Bug: https://bugs.gentoo.org/740898 Bug: https://bugs.gentoo.org/740904 Package-Manager: Portage-3.0.6, Repoman-3.0.1 Signed-off-by: Zac Medico <zmedico@gentoo.org> sys-apps/portage/Manifest | 1 + sys-apps/portage/portage-3.0.6.ebuild | 265 ++++++++++++++++++++++++++++++++++ 2 files changed, 266 insertions(+)