Quick Regex Question

From: Howard Cole <howardnews(at)selestial(dot)com>
To: 'PgSql General' <pgsql-general(at)postgresql(dot)org>
Subject: Quick Regex Question
Date: 2007-12-20 09:56:00
Message-ID: 476A3C30.3060801@selestial.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi all,

I don't understand the last result:

select 'Ho Ho Ho' ~* '^Ho'; returns true
select 'Ho Ho Ho' ~* ' Ho'; returns true
select 'Ho Ho Ho' ~* '[^ ]Ho'; returns false (Please note there is a
space between ^ and ])

From my limited experience of regex, the last one is searching for either
'Ho' preceeeded by space or
'Ho' at the beginning of a string.

How come it returns false?

Thanks.

P.S. The Ho's are Santa type Ho's - Not the other kind.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Florian Aumeier 2007-12-20 10:10:08 Re: Quick Regex Question
Previous Message Wolfgang Keller 2007-12-20 09:40:34 Re: Composite types for composite primary/foreign keys?