code: def parse_content_disposition(text):
      '''Parse a Content-Disposition header value.'''
      match = re.search(r'filename\s*=\s*(.+)', text, re.IGNORECASE)
  
      if not match:
          return
  
      filename = match.group(1)
  
      if filename[0] in '"\'':
          match = re.match(r'(.)(.+)(?!\\)\1', filename)
  
          if match:
              filename = match.group(2).replace('\\"', '"')
  
              return filename
  
      else:
          filename = filename.partition(';')[0].strip()
          return filenamf parse_content_disposition(text):
      '''Parse a Content-Disposition header value.'''
      match = re.search(r'filename\s*=\s*(.+)', text, re.IGNORECASE)
  
      if not match:
          return
  
      filename = match.group(1)
  
      if filename[0] in '"\'':
          match = re.match(r'(.)(.+)(?!\\)\1', filename)
  
          if match:
              filename = match.group(2).replace('\\"', '"')
  
              return filename
  
      else:
          filename = filename.partition(';')[0].strip()
          return filename
docs: Parse a Content-Disposition header value.