Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

print next line

# with Regular Expression 
import re

fruit_list = open('test.txt')
search_words = ['apple', 'banana', 'orange', 'lemon']

patten = re.compile("(.*(apple|banana|orange|lemon)(.*))")

for i in [re.search(patten,line).groups() for line  in      fruit_list  if re.search(patten,line) != None]: print(i)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #print #line
ADD COMMENT
Topic
Name
3+3 =