15 lines
384 B
Python
15 lines
384 B
Python
import re
|
|
|
|
with open("index.php", "r", encoding="utf-8") as f:
|
|
content = f.read()
|
|
|
|
# Pattern to remove the entire panel-card block
|
|
pattern = r'<div class="panel-card">[\s\S]*?</div>\s*<\?php endif; \?>'
|
|
replacement = '<?php endif; ?>'
|
|
|
|
new_content = re.sub(pattern, replacement, content)
|
|
|
|
with open("index.php", "w", encoding="utf-8") as f:
|
|
f.write(new_content)
|
|
|
|
print("done") |