```python import re def parse(v): m = re.match(r"^v?(\d+)(?:\.(\d+))?(?:\.(\d+))?$", v) g = m.groups() return tuple(int(x) if x else 0 for x in g) ```