"Tumurbaatar S." <tumurbaatar@datacom.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 ---------------------------(end of broadcast)--------------------------- TIP 4: Don't 'kill -9' the postmaster