#?encoding:?UTF-8?
import?re?
import?sys
reload(sys)
sys.setdefaultencoding('utf-8')
def?extract_number(input):
match?=?re.search(u"[\u4e00-\u9fa5]+",?input)
return?match.group()
if?__name__?==?"__main__":
print?extract_number(unicode("dss2第三季度建安大sdssd43fds",'utf8'))
#python3使用如下:
#?encoding:?UTF-8?
import?re?
def?extract_number(input):
match?=?re.search("[\u4e00-\u9fa5]+",?input)
return?match.group()
if?__name__?==?"__main__":
print?(extract_number("dss2第三季度建安大sdssd43fds"))