It's simple for a single character, e.g. the "c" from the example above:
(?<!c)cc(?!c)
This uses negative lookbehind and lookahead to make sure the two c's are not preceeded or followed by any other c's.
@ihabunek this would have been my first thought
(?<=(.))[\1]{2}[^\1]
@hirojin I did think of something similar, but [\1] matches character with ASCII code 1 (base 80), and not the backref. E.g. [\80] would match 0.
As far as I can tell, it's not possible to use back-references in square brackets.
But if you want to make it generic, e.g. match any letter, you might try using backreferences:
(?<!\1)(\w)\1(?!\1)
This produces the error: "lookbehind assertion is not fixed length" since the regex engine cannot know how big the backref is.