Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support regex search queries #53

Open
goyalyashpal opened this issue Mar 22, 2024 · 3 comments
Open

Support regex search queries #53

goyalyashpal opened this issue Mar 22, 2024 · 3 comments

Comments

@goyalyashpal
Copy link

Difference:
Upstream allows "or"-ing search terms with |. But scoop-search doesn't.

> scoop-search.exe "qalculate|autohotkey"
No matches found.
> scoop search "qalculate|autohotkey"
Results from local buckets...

Name          Version   Source      Binaries
----          -------   ------      --------
autohotkey    2.0.11    extras
qalculate     5.0.0     extras
autohotkey-np 1.1.37.02 nonportable
> scoop list | grep.exe scoop-search
Installed apps:
scoop-search          1.4.1                    main   2024-03-21 21:45:29
> scoop --version
Current Scoop version:
v0.3.1 - Released at 2022-11-15
@goyalyashpal
Copy link
Author

goyalyashpal commented Mar 22, 2024

this is extremely handy while migrating from manual installs to scoop installs.
as i can paste same expression in "bulk crap uninstaller" and in "scoop-search" to compare the offerings

> scoop search "autohotkey|qalculate|doublecmd|raku|libreof|sharex"
Results from local buckets...

Name          Version    Source      Binaries
----          -------    ------      --------
autohotkey    2.0.11     extras
doublecmd     1.0.11     extras
libreoffice   24.2.1     extras
qalculate     5.0.0      extras
sharex        16.0.1     extras
rakudo-moar   2024.02-01 main
rakudo-star   2024.02-01 main
autohotkey-np 1.1.37.02  nonportable

@shilangyu
Copy link
Owner

It seems like this is due to scoop search actually accepting regexes, not raw strings. I will rename this issue to reflect full regex support. It is unclear whether I will get to it though, seems like there is no good Regex support in zig, I would have to link against some external libraries.

@shilangyu shilangyu changed the title support | for or (same as upstream) Support regex search queries Mar 24, 2024
@Xdminsy
Copy link

Xdminsy commented Sep 8, 2024

There's a workaround for this, by altering the hook to
function scoop { if ($args[0] -eq "search" -and -not $($($args -join '') -match '[^\-_.0-9a-zA-Z]')) { scoop-search.exe @($args | Select-Object -Skip 1) } else { scoop.ps1 @args } }
to fallback to use the original scoop search, then though it will be slower than scoop-search, at least the regex functionality is not lost.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants