BUG #1687: Regular expression problem (II)

Поиск
Список
Период
Сортировка
От Halley Pacheco de Oliveira
Тема BUG #1687: Regular expression problem (II)
Дата
Msg-id 20050529181835.12094F0AC7@svr2.postgresql.org
обсуждение исходный текст
Ответы Re: BUG #1687: Regular expression problem (II)  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
The following bug has been logged online:

Bug reference:      1687
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 (II)
Details:

Maybe it would be easier to see the the problem I'm having with regular
expressions this way:

SELECT '192.168.0.15' SIMILAR TO
'([[:alnum:]_-]+).([[:alnum:]_-]+).([[:alnum:]_]+)';
 ?column?
----------
 t

SELECT '192.168.0.15' SIMILAR TO '([\\w-]+).([\\w-]+).([\\w]+)';
 ?column?
----------
 f

SELECT '192.168.0.15' ~
'^([[:alnum:]_-]+)\\.([[:alnum:]_-]+)\\.([[:alnum:]_]+)$';
 ?column?
----------
 f

SELECT '192.168.0.15' ~ '^(([[:alnum:]_-]+)\\.){2}([[:alnum:]_]+)$';
 ?column?
----------
 f

SELECT '192.168.0.15' ~ '^([\\w-]+)\\.([\\w-]+)\\.([\\w]+)$';
 ?column?
----------
 f

SELECT '192.168.0.15' ~ '^(([\\w-]+)\\.){2}([\\w]+)$';
 ?column?
----------
 f

Why does the first query gives a different output? It is not exactly the
same as the second query and similar to the others?

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Abhijeet Gupta
Дата:
Сообщение: pg_dump.exe is failing with a fatal error
Следующее
От: ""
Дата:
Сообщение: BUG #1689: problem with inheritance and foreign keys