BUG #1686: Regular expression problem - Mailing list pgsql-bugs

From Halley Pacheco de Oliveira
Subject BUG #1686: Regular expression problem
Date
Msg-id 20050528222212.D7B28F1070@svr2.postgresql.org
Whole thread Raw
Responses Re: BUG #1686: Regular expression problem  (Alvaro Herrera <alvherre@surnet.cl>)
List pgsql-bugs
The following bug has been logged online:

Bug reference:      1686
Logged by:          Halley Pacheco de Oliveira
Email address:      halleypo@yahoo.com.br
PostgreSQL version: 7.4 and 8.0
Operating system:   Linux and Windows
Description:        Regular expression problem
Details:

SELECT '200.222.197.219' SIMILAR TO
'([[:alnum:]_]+).([[:alnum:]_]+).([[:alnum:]_]+)';

 ?column?
----------
 t
(1 row)

SELECT '200.222.197.219' ~
'([[:alnum:]_]+)\\.([[:alnum:]_]+)\\.([[:alnum:]_]+)';

 ?column?
----------
 t
(1 row)

SELECT '200.222.197.219' SIMILAR TO '([\\w-]+).([\\w-]+).([\\w]+)';

 ?column?
----------
 f
(1 row)

SELECT '200.222.197.219' ~ '([\\w-]+)\\.([\\w-]+)\\.([\\w]+)';

 ?column?
----------
 t
(1 row)

Why does the third query gives a different output? It is not exactly the
same as the first query?

pgsql-bugs by date:

Previous
From: Haluk GÜNÇER
Date:
Subject: Re: BUG #1678: pw_shadow BUS ERROR
Next
From: Haluk GÜNÇER
Date:
Subject: Re: BUG #1678: pw_shadow BUS ERROR