Re: Literal dash in regular expression brackets

Поиск
Список
Период
Сортировка
От Bruno Wolff III
Тема Re: Literal dash in regular expression brackets
Дата
Msg-id 20020909144703.GA2030@wolff.to
обсуждение исходный текст
Ответ на Literal dash in regular expression brackets  (Steve <steve@infinity.rhythm.cx>)
Список pgsql-general
On Thu, Sep 05, 2002 at 14:39:26 -0400,
  Steve <steve@infinity.rhythm.cx> wrote:
>
> I'm trying to place a literal '-' in a bracketed character set in a regular
> expression for a check constraint. I am currently escaping it with a '\',
> however, it still winds up in the table definition as a non-literal dash and
> is interpreted as a character range. For instance:
>
> CREATE TABLE retest
> (
>     hostname VARCHAR(100) CHECK (hostname ~ '^[a-zA-Z0-9\-\.]+$' )
> );

It should be:
     hostname VARCHAR(100) CHECK (hostname ~ '^[-a-zA-Z0-9.]+$' )

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

Предыдущее
От: Oliver Elphick
Дата:
Сообщение: Re: starting with linux as another user...
Следующее
От: Lee Kindness
Дата:
Сообщение: SQL: how to find if a table exists?