#!/usr/bin/env python
# -*- coding: iso-8859-1 -*-

import re

# * significa cero o mas.
# \D* cero o mas caracteres que no son numeros.

p = re.compile(r"\D*(\d{3})\D*(\d{3})\D*(\d{4})\D*(\d+)$", re.VERBOSE)
s = p.search("work 1-(555) 666.1212 ext #4444")
s1 = p.search("55566612124444")
s2 = p.search("555-666-1212-4444")
print s.groups()
print s1.groups()
print s2.groups()
