Re: Scadinavian characters in regular expressions

From: Andreas Joseph Krogh <andreak(at)officenet(dot)no>
To: Søren Vainio <sva(at)Netpointers(dot)com>, "'pgsql-sql(at)postgresql(dot)org'" <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Scadinavian characters in regular expressions
Date: 2002-04-09 11:49:36
Message-ID: 200204091349.36146.andreak@officenet.no
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Tuesday 09 April 2002 13:28, Søren Vainio wrote:
> 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)

Funny, in Perl it works:

perl -e '$p = "hei hopp"; print eval ($p =~ /^[^\s]+\s[^\s]+$/) ? "true\n" :
"false\n";'

prints:
true

--
Andreas Joseph Krogh (Senior Software Developer) <andreak(at)officenet(dot)no>
A hen is an egg's way of making another egg.

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Kancha . 2002-04-09 12:00:03 replace NULL
Previous Message Søren Vainio 2002-04-09 11:28:38 Re: Scadinavian characters in regular expressions