Code Using Only Regex To find HTML Files
import re
import os
currentdir = os.getcwd()
files = os.listdir(currentdir)
pattern = "^.*html$"
prog = re.compile(pattern)
htmlfiles=[]
for file in files:
result = prog.findall(file)
if len(result)!=0:
htmlfiles.append(result[0])
for htmlfile in htmlfiles:
print(htmlfile)