Why this regexp matches?!

Поиск
Список
Период
Сортировка
От hubert depesz lubaczewski
Тема Why this regexp matches?!
Дата
Msg-id 20120204084630.GA8183@depesz.com
обсуждение исходный текст
Ответы Re: Why this regexp matches?!  (Szymon Guz <mabewlun@gmail.com>)
Re: Why this regexp matches?!  (Alban Hertroys <haramrae@gmail.com>)
Список pgsql-general
select 'depesz depeszx depesz' ~ E'^(.*)( \\1)+$';

what's worse:
$ select regexp_replace( 'depesz depeszx depesz', E'^(.*)( \\1)+$', E'\\1' );
 regexp_replace
────────────────
 depesz
(1 row)

I know that Pg regexps are limited, but even grep's regexps match this
correctly:

=$ printf 'depesz depesz depesz\ndepesz depeszx depesz\n' | grep -E '^(.*)( \1)+$';
depesz depesz depesz

Best regards,

depesz

--
The best thing about modern society is how easy it is to avoid contact with it.
                                                             http://depesz.com/

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

Предыдущее
От: John R Pierce
Дата:
Сообщение: Re: debugging the server[ module causes server cash]
Следующее
От: Szymon Guz
Дата:
Сообщение: Re: Why this regexp matches?!