I want to make a Python code that checks if a string contains something similar to:
'word.Word'=> it replaces it with'word.\nWord'.- smallLetter.capitalLetter => smallLeter.\nCapitalLetter.
I found that I should use Python regex (which actually I don't know how to write the format inside it!)
I tried creating this sample:
import re
text = 'What is the.What is thef.How did youDo that?F'
text = re.sub(r"(\.+[A-Z])", r".\n;", text)
Input: 'What are you.How did you.When did youDo that?F'
Output: 'What are you.\now did you.\nhen did youDo that?F'
I think it worked but I don't want the capital letter to be replaced, I want to keep it in the text.
For example: Input: 'Hey.Wow' -> Output: 'Hey.\nWow'
