import re
regex = re.compile(r"(\w*[aeiou][aeiou][aeiou]\w*)", flags=re.MULTILINE)
test_str = ("Life is beautiful\n"
"Obviously, the queen is courageous and gracious.\n"
"The rambunctious children had to sit quietly and await their delicious dinner.\n"
"The order of a data queue is First In First Out (FIFO)\n"
"Hello world!\n")
subst = "\"\\1+1-\\2\\3\""
result = regex.sub(subst, test_str)
if result:
print(result)
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for Python, please visit: https://docs.python.org/3/library/re.html