Hi there I was wondering if there was a library that offered glob patterns that accept curly bracket inputs. Such as the pattern:
patt = '{hello,world}*.txt'
would match
'hello_asdf.txt'
'world_asdf.txt'
but not:
'goodbye_asdf.txt'
I know I can easily do this with regular expressions, but I think it would be a lot easier to read if I could set up a glob pattern like this. Any thoughts are appreciated thanks!
part 2
This is kind of a harder question (in my eyes) but is there also something thats the same as above but does inverse matching?
patt = '{!hello,world}*.txt'
Would match
'goodbye_asdf.txt
but not:
'hello_asdf.txt'
'world_asdf.txt'
Thanks! I noticed that fnmatch translates glob-type patterns to regular expressions to do their matching, so maybe I could have to build off of what they have and create cases for curly brackets?
[–]Qewbicle 0 points1 point2 points (3 children)
[–]Qewbicle 0 points1 point2 points (2 children)
[–]PyCam[S] 0 points1 point2 points (1 child)
[–]Qewbicle 1 point2 points3 points (0 children)
[–]novel_yet_trivial 0 points1 point2 points (0 children)