regex to the file pattern glob #2008
-
Hi, I am trying to search only in files abc.<1 or 2 digit number> but not match I tried this regex but it none of this worked is there a way we can achieve this? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
When asking questions, it is always helpful to include the actual commands you're running, along with enough info to reproduce what you're seeing. This way, we can rule out other possible problems. For example, ripgrep doesn't have any option to filter files by regexes. So the fact that you're using regexes to filter files doesn't really make any sense to me. If you want to use a regex, then I'd combine it with xargs:
If your file paths don't have whitespace in them, then it could be simpler:
|
Beta Was this translation helpful? Give feedback.
When asking questions, it is always helpful to include the actual commands you're running, along with enough info to reproduce what you're seeing. This way, we can rule out other possible problems. For example, ripgrep doesn't have any option to filter files by regexes. So the fact that you're using regexes to filter files doesn't really make any sense to me.
If you want to use a regex, then I'd combine it with xargs:
If your file paths don't have whitespace in them, then it could be simpler: