def make_html_patterns():
 tags = any('builtin', ['<', '[\\?/]?>', '(?<=<).*?(?=[ >])'])
 keywords = any('keyword', [' [\\w:-]*?(?==)'])
 string = any('string', ['".*?"'])
 comment = any('comment', ['<!--.*?-->'])
 multiline_comment_start = any('multiline_comment_start', ['<!--'])
 multiline_comment_end = any('multiline_comment_end', ['-->'])
 return '|'.join([comment, multiline_comment_start, multiline_comment_end, tags, keywords, string])

def make_html_patterns ( ) : tags = any ( 'builtin' , [ '<' , '[\\?/]?>' , '(?<=<).*?(?=[ >])' ] ) keywords = any ( 'keyword' , [ ' [\\w:-]*?(?==)' ] ) string = any ( 'string' , [ '".*?"' ] ) comment = any ( 'comment' , [ '<!--.*?-->' ] ) multiline_comment_start = any ( 'multiline_comment_start' , [ '<!--' ] ) multiline_comment_end = any ( 'multiline_comment_end' , [ '-->' ] ) return '|' . join ( [ comment , multiline_comment_start , multiline_comment_end , tags , keywords , string ] )
strongly inspired from idlelib .