Skip site navigation (1) Skip section navigation (2)

Re: BUG #4044: Incorrect RegExp substring Output

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Rui Martins" <Rui(dot)Martins(at)PDMFC(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #4044: Incorrect RegExp substring Output
Date: 2008-03-19 14:43:59
Message-ID: 1278.1205937839@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-bugs
"Rui Martins" <Rui(dot)Martins(at)PDMFC(dot)com> writes:
> Here the context of the word "match" may be misleading us, in this
> conversation.
> I say this, because in my report, the second substring expression, the one
> for RoomSize:

> SUBSTRING( BedNo, '^[[:digit:]]+([a-zA-Z]*)(:[[:digit:]]+)?$' ) AS RoomSize,

> Actually returns an EMPTY String, and not a NULL, for the first 2 test
> cases, which I believe is the correct answer.

What's your point?  A zero-length substring is a legal match to that
subexpression ... unlike the third one.

			regards, tom lane

In response to

Responses

pgsql-bugs by date

Next:From: Tom LaneDate: 2008-03-19 14:53:22
Subject: Re: Problem identifying constraints which should not be inherited
Previous:From: Rui MartinsDate: 2008-03-19 11:42:10
Subject: Re: BUG #4044: Incorrect RegExp substring Output

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group