code: def parse_geometry(geometry):
      
  
      m = re.match("(\d+)x(\d+)([-+]\d+)([-+]\d+)", geometry)
      if not m:
          raise ValueError("failed to parse geometry string")
      return map(int, m.groups())
docs: Takes a geometry string, returns map of parameters.