"Tumurbaatar S." <tumurbaatar(at)datacom(dot)mn> writes:
> 2. 2 or more of same char
> how the 2nd's pattern should be look?
I think you need a back reference:
regression=# select 'abc' ~ '(.)\\1';
?column?
----------
f
(1 row)
regression=# select 'abb' ~ '(.)\\1';
?column?
----------
t
(1 row)
regards, tom lane