On 4 Feb 2012, at 9:46, hubert depesz lubaczewski wrote:
> select 'depesz depeszx depesz' ~ E'^(.*)( \\1)+$';
Peculiar.
It's probably no use to you, but a version where the repetition is expanded (for that particular string) works:
select 'depesz depeszx depesz' ~ E'^(.*)( \\1)( \\1)$';
And this works too:
select 'depesz depeszx depesz' ~ E'^(depesz)( \\1)+$';
Apparently something odd is going on between the wildcard, the repetitive part and the back-reference. That could be
justus not seeing what's wrong with the expression or be an actual bug.
> I know that Pg regexps are limited, but even grep's regexps match this
Limited? They're really not. According to the docs they are beyond POSIX compliant, even including several extensions
asthey appear in, among others, Perl. That said, the docs do mention a known limitation with braces and
forward-references- maybe this is related.
Alban Hertroys
--
The scale of a problem often equals the size of an ego.