httpd-docs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rich Bowen <rbo...@rcbowen.com>
Subject Re: sample regex patterns are mildly confusing
Date Fri, 08 Apr 2011 14:19:30 GMT
I've fixed the case that I think you're referring to. Please let me know if there are others.
Folks tend to throw .* into regular expressions frequently when it's not necessary.


On Apr 8, 2011, at 10:03 AM, hernan gonzalez wrote:

> Issue commented here
> 
>   http://stackoverflow.com/questions/5587148/regex-patterns-in-apache-rewritecond-and-friends-full-or-partial-match
> 
> It feels redundant and confusing to me to write (a single example
> among many others in the docs) :
> 
>             RewriteCond  %{HTTP_USER_AGENT}  ^Mozilla.*
> 
> when the .* is really not need - confusing, because it might lead to
> believe that Apache is trying a full match, i.e. matching the full
> string.
> 
> It would be neater and cleaner to write instead
> 
>              RewriteCond  %{HTTP_USER_AGENT}  ^Mozilla
> 
> Regards
> 
> ------------------------------------------------------------------------------
> H. Gonzalez
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: docs-unsubscribe@httpd.apache.org
> For additional commands, e-mail: docs-help@httpd.apache.org
> 

--
Rich Bowen
rbowen@rcbowen.com
rbowen@apache.org
PGP Key ID CC78C893





---------------------------------------------------------------------
To unsubscribe, e-mail: docs-unsubscribe@httpd.apache.org
For additional commands, e-mail: docs-help@httpd.apache.org


Mime
View raw message