From: Herouth Maoz <herouth@oumail.openu.ac.il>
To: Richi Plana <richip@mozcom.com>
To: pgsql-sql@postgreSQL.org
Subject: Re: [SQL] Re: [GENERAL] Determining if "in a text set"
Date: Sun, 28 Mar 1999 19:44:51 +0200
Message-ID: <l0311070db32419557de6@[147.233.148.142]> (raw)
In-Reply-To: <l0311070cb3240c3166d7@[147.233.148.142]>
References: <Pine.LNX.4.04.9903271223140.22809-100000@jaguar.mozcom.com>
At 19:24 +0200 on 28/03/1999, I wrote:
>
> If the spaces between the words in your phrase are not just plain spaces
> but can also be tabs etc, you will have to use the regexp version, and
> write something like '[ \t\r\f\n]' - though I'm less than sure that
> postgres's regular expressions support these. Can anyone tell us which
> regexp definition postgres uses?
OK, I looked into it more deeply. The regular expressions in postgres seem
to follow the rules in the 'regex(5)' manpage.
So, if the delimiters are not necessarily plain space characters, you could
match, using the '~' version, with '[[:space:]]' instead of ' '. Ugly, but
it matches also tabs and newlines.
At least it does on my solaris. I'm not sure whether this is or is not
OS-dependent.
As for the words in the field, which you said can have trailing spaces. If
these spaces also may be tabs or newlines, you should use rtrim with two
arguments, and the second argument is a string of all characters which need
removal from the end of the string. The point is, however, that you type in
an actual tab or an actual newline.
Hope you followed me so far.
Herouth
--
Herouth Maoz, Internet developer.
Open University of Israel - Telem project
http://telem.openu.ac.il/~herutma
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: herouth@oumail.openu.ac.il, richip@mozcom.com
Subject: Re: [SQL] Re: [GENERAL] Determining if "in a text set"
In-Reply-To: <l0311070db32419557de6@[147.233.148.142]>
References: <Pine.LNX.4.04.9903271223140.22809-100000@jaguar.mozcom.com> <l0311070db32419557de6@[147.233.148.142]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox