Re: Regular expressions

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Tumurbaatar S(dot)" <tumurbaatar(at)datacom(dot)mn>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Regular expressions
Date: 2004-04-12 12:21:24
Message-ID: 8501.1081772484@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Clodoaldo Pinto Neto 2004-04-12 12:43:08 Re: ERROR: REINDEX DATABASE: Can be executed only on the currently open database.
Previous Message Bruno Wolff III 2004-04-12 11:58:37 Re: system date != now()