I want to run for loop to generate new regex for checking in the file for example
import re
K = "MS-85409/LN-85409/L-1"
le = ["L-1","L-11","L-112"]
for i in le:
s="[A-Z]+-+[0-9]+/"+i+"$"
x = re.search(r's,K)
if x:
do something
else:
pass
where i want to do is,
on first loop of for s be "[A-Z]+-+[0-9]+/"+L-1$" and put that in x=re.search(r'[A-Z]+-+[0-9]+/"+L-1$',K)
and search it in K if matches do something and then second loop s will be
"[A-Z]+-+[0-9]+/"+L-11$" and put that in x=re.search(r'[A-Z]+-+[0-9]+/"+L-11$',K)
and search it in K if matches do something and so on..