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 28 Jun 2006 at 10:39, Joshua Slive wrote:

> Can you verify if you get the same result if you put that regex on its own
> in a RewriteRule (rather than in a big chain)?

Interestingly, it works on its own, but not with the preceding rules.

I tried just the immediately preceding rule and cond and it fails:

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]


> There is some possibility that this is a PCRE issue (the regex engine
> used by apache) with greedy processing.  (It may not be backtracking
> to match the third group after it already matches the first and
> second.)  

That would be a problem.  I could see the first two matching fooBar as
%1 fooBa
%2 r

Is double bracing legal to force order?  E.g.:

(.*)(([a-z])([A-Z]))(.*)

I'll try that and see what happens.


> If so, you could probably work around it by using
> ...wiki.pl/([a-z]+)([A-Z])(.*)

Unfortunately, that is not general enough to work.  It would work on:

fooBar  (one iteration)

but fail on:

foo_barName  (e.g requires second iteration and underscore not matchable.)

Generalizing to ([a-z0-9_]+)([A-Z])(.*) would fail on:

from_Dave (not camel case in the first place and it would match)

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