Re: Non-capturing expressions

Поиск
Список
Период
Сортировка
От Francisco Olarte
Тема Re: Non-capturing expressions
Дата
Msg-id CA+bJJbzEsMDpveQZ38B7M0ov6L1tkvcAU3aX5f-fW6z+0vtGBQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Non-capturing expressions  (Thom Brown <thom@linux.com>)
Список pgsql-general
Hi Thom:

On Sat, Oct 25, 2014 at 11:55 AM, Thom Brown <thom@linux.com> wrote:
Ah, I knew I missed something:

# SELECT regexp_matches('postgres','(?:g)(r)');
...snip, snip...

Yes. It's one fo the things I strongly dislike of some of the semantics of postgres ( and others ) regular engine functions. Their return value ''semantics''  depends on data, which makes them difficult to use properly when the pattern argument is unknown. I would prefer to have it always return a list with the full match in the first element, the grouped captures behind it ( i.e., {gr} for '(?:g)r', {gr,g} for '(g)r' . But I think it's dessigned more for interactive use with constant patterns than for programmatic use. 
....

I'm familiar with regular expression syntax, just famliarising myself with PostgreSQL's syntax flavour.

 
Sorry, got confused by the question, and by the fact  that I do not know of any regular expression engine with an access function which when presented with non-capturing-group1+unmarked2 returns unmarked2. Even in perl I do not know how to it.


Regards.
  Francisco Olarte.

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

Предыдущее
От: Joe Van Dyk
Дата:
Сообщение: pg killed by oom-killer, "invalid contrecord length 2190 at A6C/331AAA90" on slaves
Следующее
От: sudalai
Дата:
Сообщение: Change recovery configuration without restarting standby_node.