import re path = 'e:/GitHub/blog/public/js/bundle.min.6c8518518bf5af8d666e1b391ef3cf4caaaca7537fd1961891ed292d86eb3fed.js' with open(path, 'r', encoding='utf-8') as f: content = f.read() # Find all occurrences of initCodeFold idx = 0 matches = [] while True: idx = content.find('initCodeFold', idx) if idx == -1: break start = max(0, idx - 200) end = min(len(content), idx + 500) matches.append((idx, content[start:end])) idx += 1 print(f"Found {len(matches)} matches of 'initCodeFold'") print(f"File length: {len(content)} chars") print() for i, (pos, context) in enumerate(matches): print(f'=== Match {i+1} at position {pos} ===') print(context) print()