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