def METHOD_NAME(self, next1, next2):
    assert next1 == '/'  # otherwise we should not be called!
    self.return_buf = ''
    read = self.ins.read
    write = self.outs.write
    in_char_class = False
    write('/')
    next_char = next2
    while next_char and (next_char != '/' or in_char_class):
        write(next_char)
        if next_char == '\\':
            write(read(1))  # whatever is next is escaped
        elif next_char == '[':
            write(read(1))  # character class cannot be empty
            in_char_class = True
        elif next_char == ']':
            in_char_class = False
        next_char = read(1)
    write('/')