Supported globbing patterns
See original GitHub issueI need a glob to filter out JPG/PNG images. Is there a way to write a one-liner glob that gulp would understand instead of listing each file extension match string separately?
For example:
gulp.src( ['./app/**/*.jpg', './app/**/*.png']) // <- this works, but gets too long over time
gulp.src( ['./app/**/*.(jpg|png)']) // <- this is preferred, but doesn't work
Issue Analytics
- State:
- Created 10 years ago
- Comments:10 (7 by maintainers)
Top Results From Across the Web
A Beginner's Guide: Glob Patterns | Malik Browne
Globs, also known as glob patterns are patterns that can expand a wildcard pattern into a list of pathnames that match the given...
Read more >glob (programming) - Wikipedia
In computer programming, glob patterns specify sets of filenames with wildcard characters. For example, the Unix Bash shell command mv *.txt textfiles/ ...
Read more >Globbing Patterns - CommandBox
When a command has an argument with a type of Globber for a file path, that means you can use file globbing patterns...
Read more >glob - Greg's Wiki
Patterns (which are separated by | characters) are matched against the first word after the case itself. The first pattern which matches, "wins" ......
Read more >Glob Tool - DigitalOcean
Globs are the patterns you use when you run commands such as ls src/*.js , or you might see them used in config...
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
Try
*.{jpg,png}
with a comma. That should do it.It is because negations (globs starting with
!
) are always done last regardless of the order they are specified. Related functionality is here.