Home > Software design >  Select all files with glob, except for specific file
Select all files with glob, except for specific file

Time:09-21

I'm trying to match a glob that's all .exe's in a nested folder, but skip over UnityCrashHandler32.exe/UnityCrashHandler64.exe explicitly.

I've been playing around with some combination of !(UnityCrashHandler32\.exe|UnityCrashHandler64\.exe) but it's not lining up correctly! Can't quite see what I'm missing

Thanks so much, Ollie

Current Glob:

foo/{*/*,*}.exe

What I'd like it to do:

❌ foo/test.png
✅ foo/thing.exe
✅ foo/thing/thing.exe
❌ foo/UnityCrashHandler64.exe
❌ foo/UnityCrashHandler32.exe
❌ foo/thing/UnityCrashHandler64.exe
❌ foo/thing/UnityCrashHandler32.exe

https://www.digitalocean.com/community/tools/glob?comments=true&glob=foo/{*/*,*}.exe&matches=false&tests=foo/test.png&tests=foo/thing.exe&tests=foo/thing/thing.exe&tests=foo/UnityCrashHandler64.exe&tests=foo/UnityCrashHandler32.exe&tests=foo/thing/UnityCrashHandler64.exe&tests=foo/thing/UnityCrashHandler32.exe

CodePudding user response:

Like this maybe?

foo/**/@(!(UnityCrashHandler[0-9][0-9])).exe
  • Related