expand_doublestar#
- barecat.util.glob_helper.expand_doublestar(pattern, recursive=True)[source]#
Expand ** for SQLite GLOB. Returns list of patterns.
Since SQLite GLOB’s * matches any character including /, we need to expand ** patterns into OR’d alternatives to handle the zero-segment case.
Examples
‘/foo.txt’ -> [‘foo.txt’, ‘*/foo.txt’] ‘a//b’ -> [‘a/b’, ‘a//b’] ‘a/*’ -> [‘a’, ‘a/*’]