extract_index_nd function

Extract multiple indices inside bracket(s) as a list