Skip to content

Instantly share code, notes, and snippets.

@chadbaldwin
Last active September 1, 2023 00:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chadbaldwin/537a26a59fab2c0630e7ee2f09ae76f3 to your computer and use it in GitHub Desktop.
Save chadbaldwin/537a26a59fab2c0630e7ee2f09ae76f3 to your computer and use it in GitHub Desktop.
Testing globs in ripgrep
$string = 'Tables'
$result = '','/','*/','**/' | ? {$true} -PV left |
% { '','/','/*','/**' } -PV right |
% {
$glob = "${left}${string}${right}"
$stat = Measure-Command { $list = rg --files -g $glob }
[pscustomobject]@{
Glob = $glob
Count = $list.Count
Stat = $stat.Milliseconds
}
}
$result | ft -AutoSize
@chadbaldwin
Copy link
Author

[reserving first comment]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment