I want to print the output of two regexs run against the same file.
I have tried
import re
with open("C:\\Users\\frank\Documents\\file-with-digits.txt") as myfile:
print(re.findall(r'organizationID as int\s*=\s*(\d+)', myfile.read()))
print(re.findall(r'organizationID\s*=\s*(\d+)', myfile.read()))
and
import re
with open("C:\\Users\\frank\Documents\\file-with-digits.txt") as myfile:
print(((re.findall(r'organizationID as int\s*=\s*(\d+)', myfile.read())), re.findall(r'organizationID\s*=\s*(\d+)', myfile.read())))
In each case the second print statement shows no output.
If I run them separately they both show their unique output. How do I combine them so I see the output of both regular expressions? I can open the file twice of course and run them separately but I am thinking it must be possible to combine them.