def blacklist_factory(wb=[], nwb=[])
processed_keywords = []
processed_keywords.extend("(\b{}\b)".format(keyword) for keyword in wb)
processed_keywords.extend("({})".format(keyword) for keyword in nwb)
pattern = regex.compile(r'(?is){}'.format("|".join(processed_keywords)))
def f(s, *args):
why = []
for match in regex.finditer(pattern, s):
start, end = match.span()
why.append("Position {}-{}: {} (pattern {})".format(start, end, match, processed_keywords[match.lastindex - 1])