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

From Louis-David Mitterrand
Subject edge of word atom in PG regex engine?
Date
Msg-id 20001004124501.A4965@styx.apartia.int
Whole thread Raw
Responses Re: edge of word atom in PG regex engine?  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-general
Hello,

    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 '4:5:67'::text ~ '\<4\>'::text as match;
     match
    -------
     f
    (1 row)

    select '4:5:67'::text ~ '\b4\b'::text as match;
     match
    -------
     f
    (1 row)

Is there an equivalent under Postgres?

Thanks in advance,

--
Louis-David Mitterrand - ldm@apartia.org - http://www.apartia.org

Disclaimer - These opiini^H^H damn! ^H^H ^Q ^[ .... :w :q :wq :wq! ^d  X
exit X Q  ^C ^? :quitbye  CtrlAltDel  ~~q  :~q  logout  save/quit :!QUIT
^[zz ^[ZZZZZZ ^H  man vi ^@  ^L  ^[c  ^# ^E ^X ^I ^T ? help  helpquit ^D
mhelp ^C ^c help exit ?Quit ?q CtrlShftDel "Hey, what does this button d

pgsql-general by date:

Previous
From: Philip Warner
Date:
Subject: Re: Checking number of entries
Next
From: Peter Eisentraut
Date:
Subject: Re: edge of word atom in PG regex engine?