Re: [users@httpd] Mod-rewrite not finding text that is found by regex test site.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 27 Jun 2006 at 16:45, Joshua Slive wrote:

> On 6/26/06, Michael Daly <mikedaly@xxxxxxxx> 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@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux