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 Harald Fuchs <hari.fuchs@gmail.com>
Re: regexp_matches() quantified-capturing-parentheses oddity Tom Lane <tgl@sss.pgh.pa.us>
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 по дате отправления