Skip site navigation (1) Skip section navigation (2)

BUG #1686: Regular expression problem

From: "Halley Pacheco de Oliveira" <halleypo(at)yahoo(dot)com(dot)br>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #1686: Regular expression problem
Date: 2005-05-28 22:22:12
Message-ID: 20050528222212.D7B28F1070@svr2.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-bugs
The following bug has been logged online:

Bug reference:      1686
Logged by:          Halley Pacheco de Oliveira
Email address:      halleypo(at)yahoo(dot)com(dot)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?

Responses

pgsql-bugs by date

Next:From: Bruce MomjianDate: 2005-05-29 03:33:39
Subject: Re: [BUGS] Fwd: Bug#308535: postgresql-client: [psql] manual
Previous:From: shdDate: 2005-05-27 22:20:17
Subject: adding users

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group