fork download
  1. import re
  2. fp = open('kekka.txt', 'r', encoding='UTF-8')
  3. lines = fp.read()
  4. fp.close
  5.  
  6. names = re.findall(r'<!-- 表示エリア -->(.*?)<!-- /表示エリア -->',lines,re.DOTALL)
  7. mcount = len(names)
  8. print(f"マッチ件数は {mcount} 件です。")
  9. for i in range(mcount):
  10. print(f"{i+1}回目")
  11. print(names[i])
  12.  
  13.  
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty