﻿file = r'resources\views\test-sessions\fill.blade.php'
with open(file, 'r', encoding='utf-8') as f:
    c = f.read()

import re
# Cari semua @endif yang berdekatan
matches = [(m.start(), c[max(0,m.start()-50):m.start()+50]) for m in re.finditer(r'@endif', c)]
for pos, ctx in matches:
    print(pos, repr(ctx))
