As you said, you want \1 working as the first captured occurrence in a character class ([...]
). But \1 can capture much more than a single character, so, it can't be used inside a character class because it doesn't represent a character, but a string. To match multiple strings just use (?:...|\1|...)
Graciliano M. P.
"Creativity is the expression of the liberty".