Token referring to token

Is there a way to check if a token has the same value as an earlier token in the same pattern?
I would like to test for a repeated word with a different one in between.

I’m not sure, maybe <token><match no="1"/></token> works. It would refer to the word matched by the first token.

I will test that.