I would like to make a regex that matches groups like abbc, where each letter is a different character.
- it should contain three capture groups
- all the capture groups should contain different characters
- the second one should be matched exactly twice
Example:
bank (not matched, because the second and the third character is not the same)
rook (matched)
book (matched)
poop (not matched, because the first and the last character is the same)
So far I have been trying something like this:
(.)(.(?!\1))\2(.(?!\1)(?!\2))
This however matches poop too. How do I correct this?