Re: Quick Regex Question

Поиск
Список
Период
Сортировка
От Richard Huxton
Тема Re: Quick Regex Question
Дата
Msg-id 476A3FB5.5040608@archonet.com
обсуждение исходный текст
Ответ на Quick Regex Question  (Howard Cole <howardnews@selestial.com>)
Ответы Re: Quick Regex Question  (Howard Cole <howardnews@selestial.com>)
Список pgsql-general
Howard Cole wrote:
> Hi all,
>
> I don't understand the last result:
>
> select 'Ho Ho Ho' ~* '^Ho'; returns true
> select 'Ho Ho Ho' ~* ' Ho'; returns true
> select 'Ho Ho Ho' ~* '[^ ]Ho'; returns false (Please note there is a
> space between ^ and ])
>
>  From my limited experience of regex, the last one is searching for either
>    'Ho' preceeeded by space or
>    'Ho' at the beginning of a string.

No, it's searching for not-space, the ^ inverts the meaning of the
square brackets. You probably want something like '(^Ho)|( Ho)'

--
   Richard Huxton
   Archonet Ltd

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

Предыдущее
От: Florian Aumeier
Дата:
Сообщение: Re: Quick Regex Question
Следующее
От: Marco Aurélio V. da Silva
Дата:
Сообщение: Re: Problem with collector statistic