nl: re.U and re.S, substitute the result for re_words. call the function re.compile with 2 arguments: raw string '<.*?>|(.)' and bitwise OR performed with 2 operands,
code: re_chars = re . compile ( r'<.*?>|(.)' , re . U | re . S )