question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Supported globbing patterns

See original GitHub issue

I 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:closed
  • Created 10 years ago
  • Comments:10 (7 by maintainers)

github_iconTop GitHub Comments

26reactions
macucommented, Mar 17, 2014

Try *.{jpg,png} with a comma. That should do it.

1reaction
heikkicommented, Oct 27, 2014

It is because negations (globs starting with !) are always done last regardless of the order they are specified. Related functionality is here.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found