Re: BUG #4044: Incorrect RegExp substring Output

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #4044: Incorrect RegExp substring Output
Дата
Msg-id 13780.1205882724@sss.pgh.pa.us
обсуждение исходный текст
Ответ на BUG #4044: Incorrect RegExp substring Output  ("Rui Martins" <Rui.Martins@pdmfc.com>)
Ответы Re: BUG #4044: Incorrect RegExp substring Output  ("Rui Martins" <Rui.Martins@PDMFC.com>)
Re: BUG #4044: Incorrect RegExp substring Output  ("Rui Martins" <Rui.Martins@PDMFC.com>)
Список pgsql-bugs
"Rui Martins" <Rui.Martins@pdmfc.com> writes:
> Description:        Incorrect  RegExp substring Output

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

Interesting.  It had never occurred to me that it's possible for the
whole pattern to have a match when some parenthesized subexpression
has no match.  On investigation, Tcl's regex library seems to get
this right, but textregexsubstr() doesn't.  Will fix.

> I would expect the result for BedNumber to be either NULL or the EMPTY
> String, and the later seems more logical.

It's going to be null.  Your example has no match to the parenthesized
substring --- a match would have to include a colon and some digits, no?

            regards, tom lane

В списке pgsql-bugs по дате отправления:

Предыдущее
От: "Chan, Keith \(LESA IT\)"
Дата:
Сообщение: Re: BUG #4041: error in Application Stack Builder
Следующее
От: NikhilS
Дата:
Сообщение: Re: Problem identifying constraints which should not be inherited