]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
DOC: fix a confusing typo on a regsub example
authorWilly Tarreau <w@1wt.eu>
Thu, 8 Oct 2020 16:05:56 +0000 (18:05 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 8 Oct 2020 16:05:56 +0000 (18:05 +0200)
Sébastien reported a confusing example in the doc about regsub when used
with quotes. Nested quotes are already not trivial to grasp, but when
typos are there and result in something valid, it's even worse. The closing
quote ought to have been inside the brackets. However haproxy will not make
any difference because the single quotes delimit a word and the delimited
word remains the same. Let's just not add yet another level of confusion.

doc/configuration.txt

index 3054b1c7f0fb1a83d134cff1cb9a0cd776407c57..3b14e83a188a7147b8a0ef1f2ca64bb5457cc9a1 100644 (file)
@@ -15476,7 +15476,7 @@ regsub(<regex>,<subst>[,<flags>])
 
      # capture groups and backreferences
      # both lines do the same.
-     http-request redirect location %[url,'regsub("(foo|bar)([0-9]+)?","\2\1",i)]'
+     http-request redirect location %[url,'regsub("(foo|bar)([0-9]+)?","\2\1",i)']
      http-request redirect location %[url,regsub(\"(foo|bar)([0-9]+)?\",\"\2\1\",i)]
 
 capture-req(<id>)