regex in plpgsql function

Поиск
Список
Период
Сортировка
Искать
От
Culley Harrelson
Тема
regex in plpgsql function
Дата
Msg-id
20040122173614.GB29114@abcteach.com
Список
Дерево обсуждения
regex in plpgsql function Culley Harrelson <culley@fastmail.fm>
Re: regex in plpgsql function Bruno Wolff III <bruno@wolff.to>
Re: regex in plpgsql function Culley Harrelson <culley@fastmail.fm>
I am using 7.4.1

Basically I am trying to use a regex that will match:

john smith
john r smith
john r. smith

When I use:

siteadmin=# select 'john r. smith' ~ '^\\w+\\s+\\w?\\.?\\s?\\w+$';
 ?column? 
 ----------
  t
  (1 row)

all is well but:

CREATE OR REPLACE FUNCTION f_tmp(TEXT) RETURNS BOOLEAN AS ' --{{{

    BEGIN
        RETURN $1 ~ ''^\\w+\\s+\\w?\\.?\\s?\\w+$'';
    END;
' language 'plpgsql'; 

siteadmin=# select f_tmp('john r. smith');
 f_tmp 
 -------
  f
  (1 row)

makes the same regex seem to behave differently.  What am I doing wrong?

culley
В списке pgsql-general по дате отправления
От: John Sidney-Woollett
Дата:
От: Bruno Wolff III
Дата:
Сообщение: Re: trust auth in 7.4
FAQ