What are glob patterns and how to use them? #30
-
Can we get a more comprehensive explanation of the file selector syntax? Or a link to one? Because I'm trying to do something like this: "files-primary": "toomanybinds-wrapper/build/libs/((*+1.19) && !(*-@(dev|sources))).jar" , so an inclusive condition plus an exclusive one combined, and I can't find out if it works without uploading (potentially wrong) files to CurseForge/Modrinth 😅 Also, is it possible to use regex? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi! :)
Please, take a look at the
It clearly states that
If I understand your intentions correctly, you need something like this: files-primary: toomanybinds-wrapper/build/libs/*+1.19!(*-@(dev|sources)).jar Just like with regular expressions, you do not need to specify a conjunction explicitly.
Don't worry, there are a lot of online tools that can help you test your glob patterns. Personally, I like the one made by DigitalOcean, where you can test that glob I wrote, and learn more about globs in general.
No, it's not and it will likely never be possible. Support of more than one pattern language may be confusing for users, and it is also unnecessary. Globs are far more suitable for file selection than more generic regular expressions. This syntax is the de facto standard for such tasks wherever you look, from |
Beta Was this translation helpful? Give feedback.
Hi! :)
Please, take a look at the
Inputs
section of README a little bit more carefully:build/libs/*.jar
build/libs/!(*-@(dev|sources)).jar
build/libs/!(*-@(dev|sources)).jar
build/libs/*-@(dev|sources).jar
build/libs/*-@(dev|sources).jar
It clearly states that
files
,files-primary
, andfiles-secondary
inputs useglob
patterns. Of course, I did not inventa wheelyet another pattern language :)