import rep = re.compile(r'(?<!#)\b(?:promocode|promo code|promo|coupon code|code|coupon)\b')test_str = "promo #promo "print(p.sub('', test_str))
Standard input is empty
#promo
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!