glob2regex Converts glob search format to regex format Install pip install glob2regex Example of usage from glob2regex import glob2regex glob_search = '/home/*/ST-*/q[01-10]*.pdf' regex = glob2regex(glob_search) print(regex)