fork download
  1. import re
  2. my_other_string = 'the_boathouse_has_sunk'
  3. my_list = ['car', 'boat', 'truck']
  4. my_other_string = re.sub(r'[\W_]', ' ', my_other_string)
  5. my_list = re.compile(r'\b(?:%s)\b' % '|'.join(my_list))
  6. if re.search(my_list, my_other_string):
  7. print('yay')
Success #stdin #stdout 0.01s 7688KB
stdin
Standard input is empty
stdout
Standard output is empty