import re path = r"d:\radionica3d\src\pages\Admin.vue" with open(path, 'r', encoding='utf-8') as f: content = f.read() # Define the pattern to find the portfolio section # We'll use a broad pattern to find the div with the portfolio tab pattern = re.compile(r'(\s+
\s+
)', re.DOTALL) portfolio_replacement = """
{{ pi.is_public ? 'Public' : 'Private' }} No Consent

{{ pi.material_name }}

""" new_content = pattern.sub(portfolio_replacement, content) with open(path, 'w', encoding='utf-8') as f: f.write(new_content) print("Replacement successful")