G'MIC exercises

One question is if I get the user input and they use the dot shortcut how would I change it to [index] output. Or more generally, if the user input was [index pattern], how would I simplify it to a more general form like [0,1,…]?

This is related to the question that I posed in post 492 and continued in post 518. I want to simplify the index and name outputs. The user can refer to the same images in any number of ways available, and the name could be the original or a copy, but I would like to output a simplified index and retain the name (whether it be the original or a copy).