Search Postgresql Archives

regexp_matches() quantified-capturing-parentheses oddity

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

Attachment: signature.asc
Description: This is a digitally signed message part.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux