Bug 46782

Summary: list of what characters need to be escaped is hard to find
Product: Apache httpd-2 Reporter: Dan Jacobson <jidanni>
Component: DocumentationAssignee: HTTP Server Documentation List <docs>
Status: RESOLVED INVALID    
Severity: trivial CC: poirier
Priority: P5    
Version: 2.2.11   
Target Milestone: ---   
Hardware: All   
OS: Linux   
URL: http://perishablepress.com/press/2008/05/13/perishable-press-3g-blacklist/#comment-70468

Description Dan Jacobson 2009-03-01 09:46:35 UTC
The list of what characters need to be escaped is hard to find.
Please see the above URL.
Comment 1 Dan Poirier 2009-03-01 09:55:07 UTC
You're thinking too hard.  If a parameter is documented as a regular expression, escape it like a regular expression.  Otherwise, don't.
Comment 2 Dan Jacobson 2009-03-01 10:09:46 UTC
Be sure to document it somewhere. E.g.,
A two second look at e.g., man bash shows lots when grepping 'escaped'.
Comment 3 Dan Poirier 2009-03-01 10:22:01 UTC
To me it is documented - it says its a regular expression.  If someone doesn't know what that is, the Apache web server glossary gives a brief explanation and a link to more information.  If that doesn't help, there are whole books written on the subject.

What would you suggest?  There are many directives that use regular expressions, and I don't think inserting a book about how regular expressions work under each directive that uses one is practical.
Comment 4 Dan Jacobson 2009-03-01 10:37:28 UTC
OK, I found "Apache uses Perl Compatible Regular Expressions provided by the PCRE..."
Which is good enough.

Too bad I was grepping on "backslash" and "escape". so I never found it... (unlike on the bash man page.)