A file which matches the pattern in multiple ways is returned multiple times
See original GitHub issueSuppose I have the following file:
C:\files\a\a\a\b.txt
When I use the following code:
string[] matchingFiles = Glob.Files(@"C:\files", "**/a/**/b.txt").ToArray();
matchingFiles
result is:
[0] = a\a\a\b.txt
[1] = a\a\a\b.txt
[2] = a\a\a\b.txt
When I add another a\
subfolder, it gets another item added etc.
Is this by design? I would rather get distinct values.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:5 (3 by maintainers)
Top Results From Across the Web
grep multiple patterns and print results with the match pattern
grep will output the file name and the full line containing your pattern. If you only want to display the pattern that was...
Read more >Using find to locate files that match one of multiple patterns
I was trying to get a list of all python and html files in a directory with the command find Documents -name "*.{py,html}"...
Read more >How to Grep for Multiple Strings, Patterns or Words
Use grep to search for multiple patterns or words in a file by following examples in this guide. The grep tool is one...
Read more >Using Grep & Regular Expressions to Search for Text ...
Grep is a tool used to search for specified patterns within text input using regular expressions. Regular expressions are a system for ...
Read more >How to search multiple Words, Strings, Patterns with grep
Grep for multiple patterns to search through a list of strings / words through a files under Linux, macOS, *BSD or UNIX bash/ksh...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Fixed in version 1.1.7
How about just using a
HashSet<string>
to store the paths? That way, duplicates won’t be stored, and it’sO(1)
insertion time complexity (almost no cost).