import re


def parse_geometry(geom):
    """Return a width, height, x, y tuple from a Tk geometry."""

    re_match = re.match(r'(\d+)x(\d+)\+(\d+)\+(\d+)', geom)
    if re_match:
        return re_match.group(1, 2, 3, 4)