Re: patch adding new regexp functions

Поиск
Список
Период
Сортировка
От David Fetter
Тема Re: patch adding new regexp functions
Дата
Msg-id 20070216174936.GE21379@fetter.org
обсуждение исходный текст
Ответ на Re: patch adding new regexp functions  (Peter Eisentraut <peter_e@gmx.net>)
Ответы Re: patch adding new regexp functions  (Andrew Dunstan <andrew@dunslane.net>)
Re: patch adding new regexp functions  (Peter Eisentraut <peter_e@gmx.net>)
Список pgsql-patches
On Fri, Feb 16, 2007 at 05:54:47PM +0100, Peter Eisentraut wrote:
> Am Freitag, 16. Februar 2007 17:11 schrieb David Fetter:
> > > As for the regexp_matches() function, it seems to me that it
> > > returns too much information at once.  What is the use case for
> > > getting all of prematch, fullmatch, matches, and postmatch in
> > > one call?
> >
> > If not in one call, how would you get it?  Perl, for example,
> > makes these available to any regex match in the form of variables
> > it sets.
>
> The question is, what is the use case?  If there is one in Perl, can
> this proposed function API support it?

Perl makes the following variables available in any regex match,
although it optimizes some cases for when they're not there:

$1, ... $n (captured matches in parentheses)
$`         (pre-match)
$'         (post-match)
$&         (whole match)

Cheers,
D
--
David Fetter <david@fetter.org> http://fetter.org/
phone: +1 415 235 3778        AIM: dfetter666
                              Skype: davidfetter

Remember to vote!

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [GENERAL] ISO week dates
Следующее
От: Andrew Dunstan
Дата:
Сообщение: Re: patch adding new regexp functions