Re: Dollar quoting inside a regex bracket expression

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Dollar quoting inside a regex bracket expression
Дата
Msg-id 18124.1096256742@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Dollar quoting inside a regex bracket expression  (David Fetter <david@fetter.org>)
Ответы Re: Dollar quoting inside a regex bracket expression  (David Fetter <david@fetter.org>)
Список pgsql-bugs
David Fetter <david@fetter.org> writes:
> CREATE OR REPLACE FUNCTION has_bad_chars(text) RETURNS BOOLEAN
> AS $function$
>      SELECT $1 ~ $q$[\t\r\n\v|$qq$\$qq$]$q$;
> $function$ LANGUAGE SQL;

Why would you expect that to work?  Dollar-quote is not a construct
known to any regex engine that I know about.  What you've got there
is a bracket expression redundantly matching the set of characters
    \t \r \n \v | $ q
(I think that's what it will be read as, anyway, but I'm not a
regexp guru...)

            regards, tom lane

В списке pgsql-bugs по дате отправления:

Предыдущее
От: David Fetter
Дата:
Сообщение: Dollar quoting inside a regex bracket expression
Следующее
От: Stephan Szabo
Дата:
Сообщение: Re: BUG #1266: Improper unique constraint / MVCCactivitieswithin