Michael Fuhr <[EMAIL PROTECTED]> wrote:
Offhand I can't think of a way to do what you want with regexp_replace()
but you could use PL/Perl. Something like this should work:
CREATE FUNCTION mcfix(text) RETURNS text AS $$
$_[0] =~ s/\bMc([a-z])/Mc\u$1/g;
return $_[0];
$$ LANGUAGE plperl IMMUTABLE STRICT;
SELECT mcfix('John Mcneil');
mcfix
-------------
John McNeil
(1 row)
How low will we go? Check out Yahoo! Messengers low PC-to-Phone call rates.