]> Savannah Git Hosting - gnulib.git/commitdiff
doc: document trouble with back-references
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 30 Dec 2019 08:22:05 +0000 (00:22 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 30 Dec 2019 08:22:32 +0000 (00:22 -0800)
* doc/regex.texi (Back-reference Operator): Mention bugs etc.

ChangeLog
doc/regex.texi

index 6d7237d1727e27501666dfd55a75c9af2fb51e11..dccdf7a1a9149336247a8cae32381ffa281472bb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2019-12-30  Paul Eggert  <eggert@cs.ucla.edu>
+
+       doc: document trouble with back-references
+       * doc/regex.texi (Back-reference Operator): Mention bugs etc.
+
 2019-12-29  Paul Eggert  <eggert@cs.ucla.edu>
 
        doc: use “back-reference” for \1 etc.
index 7b83cdd8e114824615644d14534da088010489d2..4e0da9b397fd57bc6b9123bfabda0f44d2d43c89 100644 (file)
@@ -1144,6 +1144,18 @@ example, @samp{(a(b))\2*} matches @samp{a} followed by two or more
 If there is no preceding @w{@var{digit}-th} subexpression, the regular
 expression is invalid.
 
+Back-references can greatly slow down matching, as they can generate
+exponentially many matching possibilities that can consume both time
+and memory to explore.  Also, the POSIX specification for
+back-references is at times unclear.  Furthermore, many regular
+expression implementations have back-reference bugs that can cause
+programs to return incorrect answers or even crash, and fixing these
+bugs has often been low-priority---for example, as of 2019 the GNU C
+library bug database contained back-reference bugs 52, 10844, 11053,
+and 23522, with little sign of forthcoming fixes.  Luckily,
+back-references are rarely useful and it should be little trouble to
+avoid them in practical applications.
+
 
 @node Anchoring Operators
 @section Anchoring Operators