regexp_matches() quantified-capturing-parentheses oddity

Поиск
Список
Период
Сортировка
От Julian Mehnle
Тема regexp_matches() quantified-capturing-parentheses oddity
Дата
Msg-id 200912081603.13076.julian@mehnle.net
обсуждение исходный текст
Ответы Re: regexp_matches() quantified-capturing-parentheses oddity  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Hi all,

  wisu-dev=# SELECT regexp_matches('quux@foo@bar.zip', '([@.]|[^@.]+)', 'g');
   {quux}
   {@}
   {foo}
   {@}
   {bar}
   {.}
   {zip}

So far, so good.  However, can someone please explain the following to me?

  wisu-dev=# SELECT regexp_matches('quux@foo@bar.zip', '([@.]|[^@.]+)+', 'g');
   {p}

  wisu-dev=# SELECT regexp_matches('quux@foo@bar.zip', '([@.]|[^@.]+){1,2}', 'g');
   {@}
   {@}
   {.}
   {p}

  wisu-dev=# SELECT regexp_matches('quux@foo@bar.zip', '([@.]|[^@.]+){1,3}', 'g');
   {foo}
   {.}
   {p}

What's going on here??

Regards,

-Julian Mehnle

Вложения

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

Предыдущее
От: Glyn Astill
Дата:
Сообщение: Re: LDAP configuration changes in 8.4?
Следующее
От: "Gauthier, Dave"
Дата:
Сообщение: how to allow a sysid to be a superuser?