Re: Simple method to format a string - Mailing list pgsql-sql

From Emi Lu
Subject Re: Simple method to format a string
Date
Msg-id 4FE22848.5050309@encs.concordia.ca
Whole thread Raw
In response to Re: Simple method to format a string  ("ktm@rice.edu" <ktm@rice.edu>)
List pgsql-sql
> Just a small optimization would be to use a backreference with regexp_replace
> instead of regexp_matches:
>
> select regexp_replace('foobarbaz', '(...)', E'\\1 ', 'g');
>   regexp_replace
> ----------------
>   foo bar baz

Great.

After combined with several more replace(s), regexp_replace will provide 
me the expecting result.

Thanks!
Emi

-- 
select
regexp_replace(   replace(       replace(col-val, ' ', ''), '-', ''),        .... replace...    '(...)', E'\\1 ', 'g')
from tn;




pgsql-sql by date:

Previous
From: "ktm@rice.edu"
Date:
Subject: Re: Simple method to format a string
Next
From: Craig Ringer
Date:
Subject: Re: Is there a similarity-function that minds national charsets?