From: gnari <gnari@simnet.is>
To: Ken Tanzer <ktanzer@desc.org>
To: pgsql-general@postgresql.org
Subject: Re: Regexp matching: bug or operator error?
Date: Wed, 24 Nov 2004 00:23:33 -0000
Message-ID: <01c601c4d1bb$d4df25a0$0100000a@wp2000> (raw)
References: <41A3C6C6.2090605@desc.org>
From: "Ken Tanzer" <ktanzer@desc.org>
> Using Postgres V. 7.4.1, the following query:
>
> SELECT substring('X12345X' FROM '.*?([0-9]{1,5}).*?');
>
> Returns '1'. I would expect it to return '12345'. Is this a bug, or am
> I missing something? Thanks.
the results of mixing greedy and non-greedy repetitions can be difficult to
predict.
try SELECT substring('X12345X' FROM '\\D*(\\d{1,5}).*?');
gnari
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-docs@postgresql.org
Cc: gnari@simnet.is, ktanzer@desc.org, pgsql-general@postgresql.org
Subject: Re: Regexp matching: bug or operator error?
In-Reply-To: <01c601c4d1bb$d4df25a0$0100000a@wp2000>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox