Re: [SQL] Re: [GENERAL] Determining if "in a text set"

From: Herouth Maoz <herouth(at)oumail(dot)openu(dot)ac(dot)il>
To: Richi Plana <richip(at)mozcom(dot)com>, pgsql-sql(at)postgreSQL(dot)org
Subject: Re: [SQL] Re: [GENERAL] Determining if "in a text set"
Date: 1999-03-28 17:44:51
Message-ID: l0311070db32419557de6@[147.233.148.142]
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-sql

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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Richi Plana 1999-03-28 18:10:55 Re: [SQL] Re: [GENERAL] Determining if "in a text set"
Previous Message Herouth Maoz 1999-03-28 17:24:50 Re: [GENERAL] Determining if "in a text set"

Browse pgsql-sql by date

  From Date Subject
Next Message Richi Plana 1999-03-28 18:10:55 Re: [SQL] Re: [GENERAL] Determining if "in a text set"
Previous Message Herouth Maoz 1999-03-28 17:24:50 Re: [GENERAL] Determining if "in a text set"