(?P<filter_name>\w+)(?:%(arg_sep)s(?:(?P<constant_arg>%(constant)s)|(?P<var_arg>[%(var_chars)s]+|%(num)s)))?)", where 'constant' is replaced with constant_string, 'num' with raw string '[-+\.]?\d[\d\.e]*', 'var_chars' with string "\w\.", 'filter_sep' with result of the function re.escape called with an argument FILTER_SEPARATOR, anbd 'arg_sep' with result of the function re.escape called with an argument FILTER_ARGUMENT_SEPARATOR. call the function re.compile with 2 arguments: filter_raw_string and result for bitwise OR on 2 operands re.UNICODE and re.VERBOSE,
filter_re = re . compile ( filter_raw_string , re . UNICODE | re . VERBOSE )