title: Python3 code that reformats file names
body: <pre><code># Regex pattern
  filePattern = re.compile(r'''
      (#LPy3THW_Ex)
      (\d){1,3}
      (_macOS|_Windows)?
      (\.mp4)
      ''', re.VERBOSE)
  </code></pre>
  
  <p>I am writing a program that is supposed to simplify "LPy3THW_Ex6.mp4" to "ex6.mp4". When I run it, below is the error message. I'm not sure what the problem is and how to fix it.</p>
  
  <pre><code>Traceback (most recent call last):
    File "file_rename.py", line 13, in &lt;module&gt;
      ''', re.VERBOSE)
    File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/re.py", line 233, in compile
      return _compile(pattern, flags)
    File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/re.py", line 301, in _compile
      p = sre_compile.compile(pattern, flags)
    File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/sre_compile.py", line 562, in compile
      p = sre_parse.parse(p, flags)
    File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/sre_parse.py", line 855, in parse
      p = _parse_sub(source, pattern, flags &amp; SRE_FLAG_VERBOSE, 0)
    File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/sre_parse.py", line 416, in _parse_sub
      not nested and not items))
    File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/sre_parse.py", line 768, in _parse
      source.tell() - start)
  sre_constants.error: missing ), unterminated subpattern at position 2 (line 2, column 2)
  </code></pre>