Reference to other token in token

is it possible to match 2 tokens, to catch the ‘repeated’ foo in ‘foo bar foo’? Where (foo could be any word)

Yes, please see Development Overview - LanguageTool Wiki

Thanks, but I had problems with it. It also considers the sent_start a token, so I had to add that as an exception.