Re: edge of word atom in PG regex engine? - Mailing list pgsql-general

From Peter Eisentraut
Subject Re: edge of word atom in PG regex engine?
Date
Msg-id Pine.LNX.4.21.0010041335340.934-100000@peter.localdomain
Whole thread Raw
In response to edge of word atom in PG regex engine?  (Louis-David Mitterrand <cunctator@apartia.ch>)
List 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@gmx.net       http://yi.org/peter-e/


pgsql-general by date:

Previous
From: Louis-David Mitterrand
Date:
Subject: edge of word atom in PG regex engine?
Next
From: Peter Eisentraut
Date:
Subject: Re: alternative DB locations