| От | Tom Lane |
|---|---|
| Тема | Re: regular expression substittion function? |
| Дата | |
| Msg-id | 2712.982255179@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Re: regular expression substittion function? (Bruno Wolff III <bruno@wolff.to>) |
| Список | pgsql-general |
Bruno Wolff III <bruno@wolff.to> writes:
> It just seemed that things would be simpler to write and understand if
> I could have used a perl like substitution function.
Why do you want a "perl-like" substitution function when you have real
Perl available?
CREATE FUNCTION perlsub(text, text, text) RETURNS text AS '
my ($data, $pat, $repl) = $_;
$data =~ s/$pat/$repl/;
return $data
' LANGUAGE 'plperl';
(I'm not much of a Perl expert, but I think this is right.)
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> Added to TODO:
> * Add sed-like regular expression search/replace capability
I fail to understand this enthusiam for building our own wheel, when
we already have a Formula I racer at hand. Two of them, in fact.
regards, tom lane
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера