| От | io.sys |
|---|---|
| Тема | syntax error in plperl wrapper for Perl regex replace. |
| Дата | |
| Msg-id | 20180823192005.639d4531@aps.gogo обсуждение исходный текст |
| Список | pgsql-novice |
Hi, I am trying to create a simple wrapper to use Perl regexp replace capabilites, which supports \L (aka "lowercase from here on") in a replacement-strings, not available in postgre native regexp functions. Based on this article: https://www.anchor.com.au/blog/2013/09/extending-postgresql-high-level-languages-cats/ I copy-pasted the function code with a little adjustment, leading to: ---------- create or replace function perl_regexp_replace (text, text, text, text) returns text as $funcbody$ $_=$_[0]; s/$_[1]/$_[2]/$_[3]; return $_; $funcbody$ language plperl immutable; ---------- When running the above code, I get a syntax error in the line "s/..". When I remove this line, the function compiles, but (of course) does not do anything usefull. So, what is wrong with line: s/$_[1]/$_[2]/$_[3]; Thank in advance for reply. R.Golis, Prague.
В списке pgsql-novice по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера