How to make python ignore square bracket? I have a code it work with fine with with file name does not contain square bracket []
an example:
10245,13445.avi
def insert_types(out, dir):
for root, dirs, files in walk(dir):
   for f in os.listdir(dir):
        match =  search(r&quot;(\d+),(\d+)\.avi$&quot;, f)
        if match:
            startframe = match.group(1)
            endframe = match.group(2)
            out = fvf.InsertSign(out, join(root, f), int(startframe), int(endframe), matrix=&quot;709&quot;)
return out

This code works with .avi file format and it take the first and the second values with the comma mark ,  and its only work with the filename which does not contain square bracket like  10245,13445.avi
But now I want to make this code ignore the square bracket [] in file name [10245,13445].avi  how it gonna be, any help?
Thanx in advance
the regex pattern should be
search(r&quot;(\d+),(\d+)\]*\.avi$&quot;, f)

previously, the pattern is &quot;13445&quot; + &quot;.avi&quot;
now, the pattern is &quot;13445&quot; + &quot;]&quot; + &quot;.avi&quot;, and it should be fine with or without square brackets.