Re: regexp_replace usage
| От | chester c young |
|---|---|
| Тема | Re: regexp_replace usage |
| Дата | |
| Msg-id | 20061002151503.88141.qmail@web54309.mail.yahoo.com обсуждение исходный текст |
| Ответ на | Re: regexp_replace usage (Michael Fuhr <mike@fuhr.org>) |
| Список | pgsql-sql |
Thanks !<br /><br /><b><i>Michael Fuhr <mike@fuhr.org></i></b> wrote:<blockquote class="replbq"
style="border-left:2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;">Offhand I can't think of a way to
dowhat you want with regexp_replace()<br />but you could use PL/Perl. Something like this should work:<br /><br
/>CREATEFUNCTION mcfix(text) RETURNS text AS $$<br /> $_[0] =~ s/\bMc([a-z])/Mc\u$1/g;<br /> return $_[0];<br />$$
LANGUAGEplperl IMMUTABLE STRICT;<br /><br />SELECT mcfix('John Mcneil');<br /> mcfix <br />-------------<br /> John
McNeil<br/>(1 row)<br /><br /></blockquote><p><hr size="1" />How low will we go? Check out Yahoo! Messengers low <a
href="http://us.rd.yahoo.com/mail_us/taglines/postman8/*http://us.rd.yahoo.com/evt=39663/*http://voice.yahoo.com">
PC-to-Phonecall rates.</a>
В списке pgsql-sql по дате отправления: