fork download
  1. import re
  2. text1 = 'I love mama so much'
  3. result = 'Nice' if re.search(r"\bmama\b", text1) else text1
  4. print(result)
Success #stdin #stdout 0.03s 9460KB
stdin
Standard input is empty
stdout
Nice