Replacing characters in a string - Mailing list pgsql-general

Hello everyone,

I need to replace all occurrences of a certain character in a string.
For that I'm using regexp_replace, but so far I only managed to
replace the first character, here's an example:

> SELECT regexp_replace('xaxx', 'x', 'e');
 regexp_replace
----------------
 eaxx
(1 row)

But the result I'd need is 'eaee'. How can I do it?

Thanks,

Luís

pgsql-general by date:

Previous
From: A B
Date:
Subject: What filesystem to use for postgres?
Next
From: Thom Brown
Date:
Subject: Re: Replacing characters in a string