formated with string created by joining elements of result of the function re.escape with an argument x, with separator '|', for every x in DOTS, and re.DOTALL, substitute the result for hard_coded_bullets_re. call the function re.compile with raw string '(?:<p>(?:&nbsp;|\s|<br \/>)*?</p>\s*)+\Z', substitute the result for trailing_empty_content_re.
trailing_empty_content_re = re . compile ( r'(?:<p>(?:&nbsp;|\s|<br \/>)*?</p>\s*)+\Z' )