def METHOD_NAME(text, from_pos):
    pos = from_pos
    while pos < len(text):
        pos = text.find("[", pos)
        if pos == -1:
            return -1
        if pos > 0 and text[pos - 1] == '\\':
            pos += 1
            continue
        return pos
    return -1