#!/usr/bin/env python
#coding=utf-8

import re

phone = "2004-959-559 # 这是一个国外电话号码"

#删除字符串中的Python注释
num = re.sub(r"#.*$","",phone)
print "电话号码是：",num

#删除非数字(-)的字符串
num = re.sub(r'\D',"",phone)
print "电话号码是：",num
