unwanted/RegexEngineReDoSSolved.py
def match_set(start, end, inp, splitted_words, match_len, regex_offset=0):

    """It matches the set the data
    present in small brackets"""
    is_matched, start_len, end_len = 0,0,0
    word_offset = 0
    for i in splitted_words:
        to_check = i+end
        vertex_offset = index_vertex_map[regex_offset + word_offset]

        if checkKey(vertex_offset_map, vertex_offset):
            if checkKey(vertex_offset_map[vertex_offset], inp):
                return vertex_offset_map[vertex_offset][inp]
            [is_matched, start_len, end_len] = match(
                start, to_check, inp, match_len, regex_offset + word_offset
            )
        word_offset+=len(i)+1
        if(is_matched):
            if checkKey(vertex_offset_map, regex_offset):
                vertex_offset_map[vertex_offset][inp] = [is_matched, start_len, end_len]
            else:
                vertex_offset_map[vertex_offset] = {}
                vertex_offset_map[vertex_offset][inp] = [is_matched, start_len, end_len]
            return [is_matched, start_len, end_len]
    if checkKey(vertex_offset_map, regex_offset):
        vertex_offset_map[vertex_offset][inp] = [False, None, None]
    else:
        vertex_offset_map[vertex_offset] = {}
        vertex_offset_map[vertex_offset][inp] = [False, None, None]
    return [False, None, None]
It matches the set the data
    present in small brackets
It matches the set the data
present in small brackets
It matches the set the data present in small brackets
def match_set(start, end, inp, splitted_words, match_len, regex_offset=0):
    is_matched, start_len, end_len = 0,0,0
    word_offset = 0
    for i in splitted_words:
        to_check = i+end
        vertex_offset = index_vertex_map[regex_offset + word_offset]
        if checkKey(vertex_offset_map, vertex_offset):
            if checkKey(vertex_offset_map[vertex_offset], inp):
                return vertex_offset_map[vertex_offset][inp]
            [is_matched, start_len, end_len] = match(
                start, to_check, inp, match_len, regex_offset + word_offset
            )
        word_offset+=len(i)+1
        if(is_matched):
            if checkKey(vertex_offset_map, regex_offset):
                vertex_offset_map[vertex_offset][inp] = [is_matched, start_len, end_len]
            else:
                vertex_offset_map[vertex_offset] = {}
                vertex_offset_map[vertex_offset][inp] = [is_matched, start_len, end_len]
            return [is_matched, start_len, end_len]
    if checkKey(vertex_offset_map, regex_offset):
        vertex_offset_map[vertex_offset][inp] = [False, None, None]
    else:
        vertex_offset_map[vertex_offset] = {}
        vertex_offset_map[vertex_offset][inp] = [False, None, None]
    return [False, None, None]
def match_set ( start , end , inp , splitted_words , match_len , regex_offset = 0 ) : is_matched , start_len , end_len = 0 , 0 , 0 word_offset = 0 for i in splitted_words : to_check = i + end vertex_offset = index_vertex_map [ regex_offset + word_offset ] if checkKey ( vertex_offset_map , vertex_offset ) : if checkKey ( vertex_offset_map [ vertex_offset ] , inp ) : return vertex_offset_map [ vertex_offset ] [ inp ] [ is_matched , start_len , end_len ] = match ( start , to_check , inp , match_len , regex_offset + word_offset ) word_offset += len ( i ) + 1 if ( is_matched ) : if checkKey ( vertex_offset_map , regex_offset ) : vertex_offset_map [ vertex_offset ] [ inp ] = [ is_matched , start_len , end_len ] else : vertex_offset_map [ vertex_offset ] = { } vertex_offset_map [ vertex_offset ] [ inp ] = [ is_matched , start_len , end_len ] return [ is_matched , start_len , end_len ] if checkKey ( vertex_offset_map , regex_offset ) : vertex_offset_map [ vertex_offset ] [ inp ] = [ False , None , None ] else : vertex_offset_map [ vertex_offset ] = { } vertex_offset_map [ vertex_offset ] [ inp ] = [ False , None , None ] return [ False , None , None ]
It matches the set the data
present in small brackets
It matches the set the data present in small brackets
"""It matches the set the data
    present in small brackets"""
start
end
inp
splitted_words
match_len
regex_offset