Re: regex help wanted

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Karsten Hilbert <Karsten(dot)Hilbert(at)gmx(dot)net>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: regex help wanted
Date: 2013-04-25 14:32:26
Message-ID: 23482.1366900346@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Karsten Hilbert <Karsten(dot)Hilbert(at)gmx(dot)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.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Thom Brown 2013-04-25 14:40:51 Re: regex help wanted
Previous Message Andres Freund 2013-04-25 14:16:23 Re: Replication terminated due to PANIC