Search code examples
glob

Match two or more files using Glob


I'm trying to figure out how to match two or more files using this Glob Online Tester.

What would be the expression to match styles/main.css and index.html files?

images/icons/home.svg
images/icons/phone.svg
images/promo.gif
images/logo.png
styles/main.css
index.html

Solution

  • It's just

    styles/main.css
    index.html
    

    As seen here:

    screenshot of patterns in action


    Alternatively you could read the documentation:

    • {} allows for a comma-separated list of "or" expressions

    ... and use this:

    {styles/main.css,index.html}