Re: [Tutor] Testing a string to see if it contains a substring (dw)

2015-01-23 Thread Mark Lawrence
On 22/01/2015 15:40, dw wrote: Thanks for your good comments. I do think I found a work around body = "" for x in range(0,len(line_array)): test_line = len(re.findall(r'[0-9]{2}/[0-9]{2}/[0-9]{4}', line_array[x])) if test_line > 0: body = body + line_array[x]+"\n" Using

Re: [Tutor] Testing a string to see if it contains a substring (dw)

2015-01-23 Thread dw
Thanks for your good comments. I do think I found a work around body = "" for x in range(0,len(line_array)): test_line = len(re.findall(r'[0-9]{2}/[0-9]{2}/[0-9]{4}', line_array[x])) if test_line > 0: body = body + line_array[x]+"\n" For each iteration re.findall returns a lis