import re with open('src/index.html', 'r', encoding='utf-8') as f: html = f.read() # Replace Navbar navbar_pattern = r'()' navbar_replacement = r'\1 gap-2.5 md:gap-3\2\3
\4' html = re.sub(navbar_pattern, navbar_replacement, html, flags=re.DOTALL) # Replace Footer footer_pattern = r'(
)(.*?)(بيان)' footer_replacement = r'\1 gap-2.5 md:gap-3\2\3
\4' html = re.sub(footer_pattern, footer_replacement, html, flags=re.DOTALL) with open('src/index.html', 'w', encoding='utf-8') as f: f.write(html) print("Done replacing.")