Simo's code doesn't work correctly, your example is also incorrect as it doesn't contain the same word twice. Here is something that works, it deletes from the left:
//echo -a $regsubex(Nickname1 Nickname1 Nickname2 Nickname3 Nickname2 Nickname1,/(?:\G| )([^ ]+) (?=(?:\1|.* \1)(?: |$))/gSi,)
Nickname3 Nickname2 Nickname1
Hi @Wims
While deleting the second repetition, it merges it with the other value. See;
//echo -a $regsubex(Nickname1 Nickname3 NickName2 Nickname2 Nickname1,/(?:\G| )([^ ]+) (?=(?:\1|.* \1)(?: |$))/gSi,)
Return:
Nickname3Nickname2 Nickname1