def findmatching(s, pos, w1='left parenthesis', w2='right parenthesis'):
    """
    Find matching parantheses.
    
    :param s: string, to be searched in
    :param pos: int, position of ( we want to find a match for
    
    :return: int, position of matching ) bracket; if there is no match, return len(s)
    """
    count = 1
    ps = pos + 1
    while count > 0 and ps < len(s):
        if s[ps:].startswith(w1):
            count += 1
        if s[ps:].startswith(w2):
            count -= 1
        if count == 0:
            break
        ps += 1
    return ps
