Open StaticPH opened 5 years ago
Possibly related to globbing behavior mentioned in https://github.com/BurntSushi/ripgrep/issues/1221 ?
That ticket seems only tangentially related. I think your problem here is related to the fact that ripgrep just drops empty alternates, so where you're expecting for example {_*,}
to be converted to something like (_[^/]*|)
(or technically (_[^/]*)?
, since the underlying regex engine doesn't support empty alternates itself), it's actually converting it to _[^/]*
What version of ripgrep are you using?
How did you install ripgrep?
Installed with cargo
What operating system are you using ripgrep on?
Windows 8.1 Pro (x86_64) If it's relevant, I'm also using the latest version of msys2-x86_64
Describe your question, feature request, or bug.
Bash and ripgrep evaluate globs differently, which seems like a bug to me. If this behavior is actually intended, I'd like help finding a glob pattern that will give the result bash does for my test pattern.
If this is a bug, what are the steps to reproduce the behavior?
In a directory I have 5 files containing only the string 'qwertyuiop' The files are named:
'.foo' '.foo_baz' 'bar.foo' 'baz.foo_bar' 'SHOULD_NOT_BE_GLOBBED'
I do not have any .ignore-like files, am not instructing ripgrep to use a configuration file, and have not set
RIPGREP_CONFIG_PATH
The glob pattern I am using for this test is
{*,}.foo{_*,}
The regex is simply "\D", which should match every character in the 5 filesIf this is a bug, what is the actual behavior?
See https://gist.github.com/StaticPH/c52d9ddee8a1a43a23196f5f46f1503e
If this is a bug, what is the expected behavior?
Simply calling
echo {*,}.foo{_*,}
in bash prints outbaz.foo_bar bar.foo .foo_baz .foo
, so I would have expected bothto output
and for
to output