The following bug has been logged online: Bug reference: 1686 Logged by: Halley Pacheco de Oliveira Email address: [EMAIL PROTECTED] 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? ---------------------------(end of broadcast)--------------------------- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq