import re with open('c:/ScriptoriumAI/scriptoriumai-ui/src/App.tsx', 'r', encoding='utf-8') as f: text = f.read() def wrap_in_suspense(match): name = match.group(1) tag = match.group(2) return f'Loading {tag}...}}><{tag} />}} />' text = re.sub(r'\} />', r'Loading workspace...}>} />', text) text = re.sub(r'\} />', wrap_in_suspense, text) with open('c:/ScriptoriumAI/scriptoriumai-ui/src/App.tsx', 'w', encoding='utf-8') as f: f.write(text) print('Done wrapping with Suspense')