I am fairly new to python. I have searched several forums and have not quite found the answer.
I have a list defined and would like to search a line for occurrences in the list. Something like
import re
list = ['a', 'b', 'c']
for xa in range(0, len(list)):
m = re.search(r, list[xa], line):
if m:
print(m)
Is there anyway to pass the variable into regex?
r? you should describe what you're trying to do (example input + output).