On Fri, Nov 6, 2015 at 7:32 PM, Tom Lane <t...@sss.pgh.pa.us> wrote:

> What I'm wondering about is whether to back-patch this.  It's possible
> that people have written patterns like this and not realized that they
> aren't doing quite what's expected.  Getting a failure instead might not
> be desirable in a minor release.  On the other hand, wrong answers are
> wrong answers.

​I'd vote to back-patch this.  The unscientific reason on my end is that I
suspect very few patterns in the wild would be affected and furthermore any
using such patterns is likely to be in a position to change it match the
existing behavior by replace the "(\1)" with the corresponding "(\w)" as
you used in you example.  We should probably suggest just that in the
release notes.  It is not a strongly held position and my first reaction
was that introducing an error should be avoided.  But regular expressions
are tricky enough to get right when the engine does what you tell it...

David J.

Reply via email to