import re
phoneNum = re.compile(r'''
(?:\d{3}-|  # area code without parentheses but with dash
\(\d{3}\)\ ) # -or- area code with parentheses and no dash
\d{3} # first 3 digits
-      # second dash
\d{4} # last 4 digits''', re.VERBOSE) 
print(phoneNum.findall('(415) 123-2342 and 415-905-1234 are the numbers.'))