The replacement argument of the substitution operator is not a regular expression. You shouldn't use \1 in it since \1 means "match what the first set of captures captured".
For example, you'd use something like the following to put brackets around repeated characters:
s/((.)\2+)/[$1]/g
Update: Added example.
In reply to Re: Regex backreferences
by ikegami
in thread Regex backreferences
by Mad_Mac
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |