Working with this expression for find the words with at least 3 numbers: \b(?<=\s).*?[0-9]{1}.*?[0-9]{1}.*?[0-9]{1}.*?\b
I tested on Pythex and it works well... but I got NONE as result, can someone help?
infile:
IZN8TEIS
IZN89EIS
F7G74VCT
K8Z5PXJ8
O3HNWT3X
QY8479AG
R12PJ6XH
IZN8TEIS
JCON42W5
with open(infile) as fin, open(outfile, "w+") as fout:
for line in fin:
match = re.search(r"\b(?<=\s).*?[0-9]{1}.*?[0-9]{1}.*?[0-9]{1}.*?\b", line)
*** IF I PRINT HERE MATCH .. ALWAYS NONE
if match: fout.write(line)
else: print(line)
Also tested with
pattern = re.compile("\b(?<=\s).*?[0-9]{1}.*?[0-9]{1}.*?[0-9]{1}.*?\b")
pattern.search(line)
same result.