Is there an easy way to normalize-space with given string functions

From: Janning Vygen <vygen(at)gmx(dot)de>
To: pgsql-sql(at)postgresql(dot)org
Subject: Is there an easy way to normalize-space with given string functions
Date: 2004-04-22 22:59:13
Message-ID: 200404230059.14221.vygen@gmx.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi,

i am looking for something like

$ SELECT btrim(replace(' too many spaces! ', '\s+',' '), '');
too many spaces

i searched the function list and tried to combine to or more functions, but i
miss a replace function which uses regular expressions.

Do i have to write my own function or did i miss something? trimming is well
supported at the start and end of string, but no trimmin in the middle seems
to be possible.

kind regards
janning

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Bruce Momjian 2004-04-22 23:46:00 Re: lifetime of temp schema versus compiled image of plpgsql proc
Previous Message Dennis 2004-04-22 21:32:13 Re: lifetime of temp schema versus compiled image of plpgsql proc