Re: edge of word atom in PG regex engine?

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: ldm(at)apartia(dot)ch
Cc: Pgsql-General(at)postgresql(dot)org
Subject: Re: edge of word atom in PG regex engine?
Date: 2000-10-04 11:37:02
Message-ID: Pine.LNX.4.21.0010041335340.934-100000@peter.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Louis-David Mitterrand writes:

> I am trying to match the following:
>
> select '4:5:67'::text ~ '4'::text as match;
> match
> -------
> t
> (1 row)
>
> but I would like to avoid '44:5:67' matching '4' so I tried including
> "word edge" regexp atoms (\b in perl, \<\> in grep and vi, etc..) but
> they don't seem to be supported in Postgres:

select '44:5:67'::text ~ '[[:<:]]4[[:>:]]';

--
Peter Eisentraut peter_e(at)gmx(dot)net http://yi.org/peter-e/

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Mart Käsper 2000-10-04 11:40:08 Q : aborting requests ?
Previous Message Philip Warner 2000-10-04 11:18:06 Re: Checking number of entries