Re: Insert a space between each character - Mailing list pgsql-sql

From Dirk Jagdmann
Subject Re: Insert a space between each character
Date
Msg-id 5d0f60990810082320n44188627weaf447e5dcf2bcff@mail.gmail.com
Whole thread Raw
In response to Re: Insert a space between each character  (Michael Toews <mwtoews@sfu.ca>)
List pgsql-sql
> Use a regular expression, e.g.:
> select trim(regexp_replace('foobarbaz', '(.)', E'\\1 ', 'g'));

And if we only match characters until the last character in the
string, we can get rid of the outer trim():

# select regexp_replace('foobarbaz', E'(.)(?!$)', E'\\1 ', 'g'); regexp_replace
-------------------f o o b a r b a z
(1 row)

-- 
---> Dirk Jagdmann
----> http://cubic.org/~doj
-----> http://llg.cubic.org


pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: 100% CPU at concurent access
Next
From: "Marcin Krawczyk"
Date:
Subject: trigger parameters, what am I doing wrong ??