import re
key = "hello world is a good idea for a T-shirt"
pat = r"\W+".join([re.escape(x) for x in key.split()])
print(pat)
text = "This is some string, that includes commas, and other punctuations. It also includes hello world, is a, good, idea for a T-shirt and other."
match = re.search(pat, text)
if match:
print("YES!")
aW1wb3J0IHJlCmtleSA9ICJoZWxsbyB3b3JsZCBpcyBhIGdvb2QgaWRlYSBmb3IgYSBULXNoaXJ0IgpwYXQgPSByIlxXKyIuam9pbihbcmUuZXNjYXBlKHgpIGZvciB4IGluIGtleS5zcGxpdCgpXSkKcHJpbnQocGF0KQp0ZXh0ID0gIlRoaXMgaXMgc29tZSBzdHJpbmcsIHRoYXQgaW5jbHVkZXMgY29tbWFzLCBhbmQgb3RoZXIgcHVuY3R1YXRpb25zLiBJdCBhbHNvIGluY2x1ZGVzIGhlbGxvIHdvcmxkLCBpcyBhLCBnb29kLCBpZGVhIGZvciBhIFQtc2hpcnQgYW5kIG90aGVyLiIKbWF0Y2ggPSByZS5zZWFyY2gocGF0LCB0ZXh0KQppZiBtYXRjaDoKCXByaW50KCJZRVMhIik=