i would like to search a word and replace it with table. the following code is just for strings:
def paragraph_replace(self, search, replace):
searchre = re.compile(search)
for paragraph in self.paragraphs:
paragraph_text = paragraph.text
if paragraph_text:
if searchre.search(paragraph_text):
paragraph.text = re.sub(search, replace, paragraph_text)
return paragraph_text
is there a way of replace it with table?