PG Bug reporting form <noreply(at)postgresql(dot)org> writes:
> When executing the following regexp call:
> select regexp_match('abc', '.*', 'b');
> valgrind detects an error:
Hah, nice one. It gives the wrong answer too, at least it does most of
the time for me:
# select regexp_match('abc', '.*', 'b');
regexp_match
--------------
{""}
(1 row)
That's because it's acting like the pattern is '.*?' (prefer shortest
match) rather than '.*'.
This bug is well over the age of consent, btw. Tcl's got it too,
so it surely is aboriginal in Henry Spencer's code.
Thanks for the report!
regards, tom lane