> On 2013-04-25, Karsten Hilbert wrote:
>> On Thu, Apr 25, 2013 at 10:32:26AM -0400, Tom Lane wrote:
>>
>>> Karsten Hilbert writes:
>>> > What I don't understand is: Why does the following return a
>>> > substring ?
>>>
>>> > select substring ('junk $$ junk' from
>>> '\$<[^<]+?::[^:]+?>\$');
>>
On 2013-04-25, Karsten Hilbert wrote:
> On Thu, Apr 25, 2013 at 10:32:26AM -0400, Tom Lane wrote:
>
>> Karsten Hilbert writes:
>> > What I don't understand is: Why does the following return a
>> > substring ?
>>
>> >select substring ('junk $$ junk' from
>> > '\$<[^<]+?::[^:]+?>\$');
>>
>>
Karsten Hilbert writes:
> I would have thought "<[^<]+?:" should mean:
> match a "<"
> followed by 1-n characters as long as they are not "<"
> until the VERY NEXT ":"
> The "?" should make the "+" after "[^<]" non-greedy and thus
> stop at the first occurrence of ":", right ?
On Thu, Apr 25, 2013 at 03:40:51PM +0100, Thom Brown wrote:
> On 25 April 2013 15:32, Tom Lane wrote:
> > Karsten Hilbert writes:
> >> What I don't understand is: Why does the following return a
> >> substring ?
> >
> >> select substring ('junk $$ junk' from
> >> '\$<[^<]+?::[^:]+?>\$');
On Thu, Apr 25, 2013 at 10:32:26AM -0400, Tom Lane wrote:
> Karsten Hilbert writes:
> > What I don't understand is: Why does the following return a
> > substring ?
>
> > select substring ('junk $$ junk' from
> > '\$<[^<]+?::[^:]+?>\$');
>
> There's a perfectly valid match in which [^<]+? m
On 25 April 2013 15:32, Tom Lane wrote:
> Karsten Hilbert writes:
>> What I don't understand is: Why does the following return a
>> substring ?
>
>> select substring ('junk $$ junk' from
>> '\$<[^<]+?::[^:]+?>\$');
>
> There's a perfectly valid match in which [^<]+? matches allergy::test
>
Karsten Hilbert writes:
> What I don't understand is: Why does the following return a
> substring ?
> select substring ('junk $$ junk' from
> '\$<[^<]+?::[^:]+?>\$');
There's a perfectly valid match in which [^<]+? matches allergy::test
and [^:]+? matches 99.
rega
Hi,
I am in the process of converting some TEXT data which I try
to identify by regular expression.
What I don't understand is: Why does the following return a
substring ?
select substring ('junk $$ junk' from
'\$<[^<]+?::[^:]+?>\$');
I would have thought the '::[^:]+?>' part should ha