OK, Hi Dave, I modified it as below and it works....(If there is a way to make this more efficient please let me know)
By the way I am using Python 3.4 import sys import re def extract_names(filename): path = '/home/LearnPython/exercises/' fullfilename = path+filename print('fullfilename: ',fullfilename) fileextract = open(fullfilename,'r') #line = fileextract.readlines() #print(line) for l in fileextract: #print(l) texts = re.search(r'\d\d\d\d', l) if texts: print(texts.group()) #print(texts.group()) #return texts.group() fileextract.close() extract_names('NOTICE.txt') Thanks, Shiva -- https://mail.python.org/mailman/listinfo/python-list