For example, where:
list = [admin, add, swear]
st = 'siteadmin'
st
contains string admin
from list
.
list
was found, and if possible where (from start to finish in order to highlight the offending string)?This would be useful for a blacklist.
list = ['admin', 'add', 'swear']
st = 'siteadmin'
if any([x in st for x in list]):print "found"
else: print "not found"
You can use any built-in function to check if any string in the list appeared in the target string