"Roman Kononov" <kononov(at)ftml(dot)net> writes:
> test=# select substring('34' from '(2|3)#"4#"' for '#');
> substring
> -----------
> 3
> (1 row)
Hmm. I guess we need to translate ( and ) to non-capturing parens.
> test=# select substring('^' from '#"^#"' for '#');
> substring
> -----------
>
> (1 row)
> test=# select substring('$' from '#"$#"' for '#');
> substring
> -----------
>
> (1 row)
These cases are already fixed in HEAD.
http://archives.postgresql.org/pgsql-committers/2009-10/msg00048.php
regards, tom lane