This is what I tried:
(.)(?=.*\1)
This removes all instances of duplicates and leaves only the last instance, ie.
telnet -> lnet
I want this result:
telnet -> teln
How do I do this? I tried looking behind, but that only accepts a fixed length as far as I know.
Need to find a REGEX for this. I know other methods to achieve this without regex