Re: Regular expressions - Mailing list pgsql-general

From Tom Lane
Subject Re: Regular expressions
Date
Msg-id 8501.1081772484@sss.pgh.pa.us
Whole thread Raw
In response to Regular expressions  ("Tumurbaatar S." <tumurbaatar@datacom.mn>)
List pgsql-general
"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

pgsql-general by date:

Previous
From: Bruno Wolff III
Date:
Subject: Re: system date != now()
Next
From: Clodoaldo Pinto Neto
Date:
Subject: Re: ERROR: REINDEX DATABASE: Can be executed only on the currently open database.