#73 RFE: Simple anti-glob pattern in search
Closed by lbrabec. Opened by churchyard.

It would sometimes be useful to be able to search packages that don't match the given search string. E.g. I'd like to browse https://packager.fedorainfracloud.org/orphan without anything that matches nodejs.

This is currently possible with ^((?!nodejs).)*$ but that's arguably a tad tedious to remember (I had to google it).

Ideas for this:

  • !nodejs
    • pros: easy to implement, can be mentioned in the placeholder
    • pros: no ! in package names
    • cons: it's a hack
  • NOT nodejs
    • pros: could be extended with full boolean logic
    • cons: could be extended with full boolean logic
    • cons: it would only be possible to use this if the search string contains spaces, because NOT can be part of a package name

I'm experimenting with pegjs and this grammar (I'm rusty in this area, but this grammar is a modification of classic textbook example for parsing arithmetic expressions):

S -> A
S -> e         // empty string is accepted
A -> M || A    // additive operation - OR
A -> M
M -> F && M    // multiplicative operation - AND
M -> F
F -> ! F       // negation
F -> ( A )     // parentheses
F -> r/regex/  // regex match
F -> string    // substring match

This grammar would be more robust that what is requested in this issue and would allow search expressions like:

!python && !nodejs
apache || nginx
rpm && !r/^python/
(rust || golang) && !(bitbucket || github)
...

It's over the top a little, but so far working with pegjs was easy and I have working prototype already... so I guess why not.

WDYT?

Why not :)

This feature is now deployed.

Looks nice. Suggestions:

  • amend the placeholder text
  • amend the search help on the help page

deployed

Metadata Update from @lbrabec:
- Issue status updated to: Closed (was: Open)

This issue has been migrated to Fedora Forge:
https://forge.fedoraproject.org/apps/packager_dashboard/issues/73

Please continue any further discussion there.

Metadata