httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Daly" <miked...@magma.ca>
Subject Re: [users@httpd] Mod-rewrite not finding text that is found by regex test site.
Date Wed, 28 Jun 2006 03:05:17 GMT
On 27 Jun 2006 at 16:45, Joshua Slive wrote:

> On 6/26/06, Michael Daly <mikedaly@magma.ca> wrote:
> > I'm trying to catch camelCase names.  The mod_rewrite log file
> > shows:
> >
> > RewriteCond: input='^/cgi-sys/cgiwrap/guille/wiki.pl/fooBar'
> > pattern='^/cgi-sys/cgiwrap/guille/wiki.pl/(.*)([a-z])([A-Z])(.*)' =>
> > not-matched
> >
> > Testing at www.regular-expressions.info/javascriptexample.html
> > gives:
> >   %1=/cgi-sys/cgiwrap/guille/wiki.pl/fo
> >   %2=0
> >   %3=B
> >   %4=ar
[...] 
> Can you show us the exact set of RewriteCond/RewriteRules you are
> using?

The following will:
1) define lc as a lower case function
2) check for desired URI and replace "$" with "/query string"
3) change first upper case letter to lower case (e.g. CamelCase to 
camelCase)

Up to this point, the log file shows everything working as expected.

4) check for next camel case and change to lower case with preceding 
underscore - (e.g. camelCase to camel_case )

This fails with log file output as shown in previous message.


RewriteMap  lc  int:tolower
RewriteCond %{REQUEST_URI} ^/cgi-sys/cgiwrap/guille/wiki.pl$     [NC]
RewriteRule  .*  /cgi-sys/cgiwrap/guille/wiki.pl/%{QUERY_STRING} [NS]
RewriteCond   $1   ^/cgi-sys/cgiwrap/guille/wiki.pl/([A-Z])(.*)       
RewriteRule ^(.*)$ ^/cgi-sys/cgiwrap/guille/wiki.pl/${lc:%1}%2   [NS]
RewriteCond   $1   ^/cgi-sys/cgiwrap/guille/wiki.pl/(.*)([a-z])([A-Z])(.*)
RewriteRule ^(.*)$ ^/cgi-sys/cgiwrap/guille/wiki.pl/%1%2_${lc:%3}%4 [N,NS]


Mike


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message