[Varnish] #359: regsub documented as using $1, $2 etc, but actually uses \1, \2 for replacement strings

Varnish varnish-bugs at projects.linpro.no
Thu Oct 23 08:19:12 CEST 2008


#359: regsub documented as using $1,$2 etc, but actually uses \1, \2 for
replacement strings
--------------------+-------------------------------------------------------
 Reporter:  eugaia  |        Type:  documentation
   Status:  new     |    Priority:  low          
Milestone:          |   Component:  documentation
  Version:  trunk   |    Severity:  minor        
 Keywords:  regsub  |  
--------------------+-------------------------------------------------------
 Everywhere I've seen in the documentation, it says that $1,$2 etc are used
 for replacement strings in regsub, e.g.

 set bereq.url = regsub ( req.url , "/from_dir/(.*)" , "/to/url=$1" );

 However, this just results in a literal '$1' inserted.  In fact \1,\2 etc
 are used, so it should be

 set bereq.url = regsub ( req.url , "/from_dir/(.*)" , "/to/url=\1" );

 This can be confusing, and should be fixed at some point.

-- 
Ticket URL: <http://varnish.projects.linpro.no/ticket/359>
Varnish <http://varnish.projects.linpro.no/>
The Varnish HTTP Accelerator


More information about the varnish-bugs mailing list