ripgrep 0.6.0
-AVX -SIMD
System Version: macOS 10.13.3 (17D47)
Kernel Version: Darwin 17.4.0
Boot Volume: Macintosh HD
I'm just not really grasping the difference between
rg -g '*something*' 'def some_method_somewhere'
and
rg -g '.*something.*' 'def some_method_somewhere'
Should I assume globs work like Unix and * are wildcards?
Also, do double quotes behave the same way?
Should I assume globs work like Unix and
*are wildcards?
Yes. As documented:
-g, --glob <GLOB>... Include or exclude files and directories for searching that match the given glob. This always overrides any other ignore logic. Multiple glob flags may be used. Globbing rules match .gitignore globs. Precede a glob with a ! to exclude it.
Globs in .gitignore files are indeed standard Unix globs. The syntax is documented exhaustively here: https://docs.rs/globset/0.3.0/globset/#syntax
Also, do double quotes behave the same way?
I don't think I can answer this question. It depends on your shell. Bash, for example, most definitely treats '...' differently than "...".
Thanks for such a fast reply, wow. Very helpful.
Most helpful comment
Yes. As documented:
Globs in
.gitignorefiles are indeed standard Unix globs. The syntax is documented exhaustively here: https://docs.rs/globset/0.3.0/globset/#syntaxI don't think I can answer this question. It depends on your shell. Bash, for example, most definitely treats
'...'differently than"...".