Files
Brancheneinstufung2/patch_cleaning.py

19 lines
696 B
Python

import sys
with open('fotograf-de-scraper/frontend/src/App.tsx', 'r') as f:
content = f.read()
# Robust cleaning logic
new_cleaning = ".replace(/\\(JOB\\d+\\)/gi, '').replace(/Kindergarten/gi, '').replace(/\\d{4}/g, '').replace(/\\s+/g, ' ').trim()"
# Old cleaning pattern (multi-line)
old_pattern = """selectedJob.name.replace(/\\(JOB\\d+\\)\\s*/, '').replace(/Kindergarten\\s+/gi, '').replace(/\\s+\\d{4}$/, '').trim()"""
if old_pattern in content:
content = content.replace(old_pattern, new_cleaning)
with open('fotograf-de-scraper/frontend/src/App.tsx', 'w') as f:
f.write(content)
print("Cleaning logic updated")
else:
print("Old cleaning pattern not found")