Is there an easy way to normalize-space with given string functions - Mailing list pgsql-sql

From Janning Vygen
Subject Is there an easy way to normalize-space with given string functions
Date
Msg-id 200404230059.14221.vygen@gmx.de
Whole thread Raw
Responses Re: Is there an easy way to normalize-space with given string functions  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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



pgsql-sql by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: lifetime of temp schema versus compiled image of plpgsql proc
Next
From: Bruce Momjian
Date:
Subject: Re: lifetime of temp schema versus compiled image of plpgsql proc