Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by postgresql.org (Postfix) with ESMTP id 093014758F3 for ; Tue, 9 Apr 2002 09:34:00 -0400 (EDT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.11.4/8.11.4) with ESMTP id g39DXtF28564; Tue, 9 Apr 2002 09:33:55 -0400 (EDT) To: =?iso-8859-1?Q?S=F8ren_Vainio?= Cc: "'Andreas Joseph Krogh'" , "'pgsql-sql@postgresql.org'" Subject: Re: Scadinavian characters in regular expressions In-reply-to: <910513A5A944D5118BE900C04F67CB5A1F82C6@MAIL> References: <910513A5A944D5118BE900C04F67CB5A1F82C6@MAIL> Comments: In-reply-to =?iso-8859-1?Q?S=F8ren_Vainio?= message dated "Tue, 09 Apr 2002 13:28:38 +0200" Date: Tue, 09 Apr 2002 09:33:55 -0400 Message-ID: <28561.1018359235@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200204/99 X-Sequence-Number: 7364 =?iso-8859-1?Q?S=F8ren_Vainio?= writes: > Using \s does produce FALSE for SELECT 'oneå two three' ~ > '^[^\s]+[\s][^\s]+$'; > But it also produces FALSE for any two-word string ex: > SELECT 'one two' ~ '^[^\s]+[\s][^\s]+$'; where I would expect TRUE??? > (I am using PostgreSQL 7.1.3) I do not believe that Postgres' regular expression engine recognizes \s as meaning anything except "s". See http://www.ca.postgresql.org/users-lounge/docs/7.2/postgres/functions-matching.html In the above, it's even worse: the backslashes were eaten by the string-literal parser, so what arrived at the RE engine was just ^[^s]+[s][^s]+$ ... not likely to produce what you wanted. As for the original issue, I wonder whether you are storing the string as UTF-8 or Latin1 encoding. I have a suspicion that the å (å å a-ring) is actually a multibyte sequence inside the database and for some reason Postgres isn't configured to recognize it as a single logical character. regards, tom lane