Re: regex help wanted
| От | Thom Brown |
|---|---|
| Тема | Re: regex help wanted |
| Дата | |
| Msg-id | CAA-aLv6YfKbhhzsRz==mFGkweTF4C7ghQS+qnbAs7CDd8FAgUQ@mail.gmail.com обсуждение исходный текст |
| Ответ на | Re: regex help wanted (Tom Lane <tgl@sss.pgh.pa.us>) |
| Ответы |
Re: regex help wanted
|
| Список | pgsql-general |
On 25 April 2013 15:32, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Karsten Hilbert <Karsten.Hilbert@gmx.net> writes:
>> What I don't understand is: Why does the following return a
>> substring ?
>
>> select substring ('junk $<allergy::test::99>$ junk' from '\$<[^<]+?::[^:]+?>\$');
>
> There's a perfectly valid match in which [^<]+? matches allergy::test
> and [^:]+? matches 99.
Yeah, I think there may be an assumption that a lazy quantifier will
stop short and cause the remainder to fail to match permanently, but
it will backtrack, forcing the lazy quantifier to expand until it can
match the expression.
--
Thom
В списке pgsql-general по дате отправления: