user17792: 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"(\d+),(\d+)\.avi$", f)
        if match:
            startframe = match.group(1)
            endframe = match.group(2)
            out = fvf.InsertSign(out, join(root, f), int(startframe), int(endframe), matrix="709")
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

user31818: the regex pattern should be
search(r"(\d+),(\d+)\]*\.avi$", f)

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

17792: <p>I have a code it work with fine with with file name does not contain square bracket []</p>
<p>an example:
<strong>10245,13445.avi</strong></p>
<pre><code>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
</code></pre>
<p>This code works with <code>.avi</code> file format and it take the first and the second values with the comma mark <code>,</code>  and its only work with the filename which does not contain square bracket like  <code>10245,13445.avi</code>
But now I want to make this code ignore the square bracket [] in file name <code>[10245,13445].avi</code>  how it gonna be, any help?</p>
<p>Thanx in advance</p>
 31818: <p>the regex pattern should be</p>
<pre><code>search(r&quot;(\d+),(\d+)\]*\.avi$&quot;, f)
</code></pre>
<p>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.</p>
