Closed Thread Icon

Topic awaiting preservation: Apache mod_rewrite expression like a negative lookback assertion (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=12622" title="Pages that link to Topic awaiting preservation: Apache mod_rewrite expression like a negative lookback assertion (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: Apache mod_rewrite expression like a negative lookback assertion <span class="small">(Page 1 of 1)</span>\

 
Emperor
Maniac (V) Mad Scientist with Finglongers

From: Cell 53, East Wing
Insane since: Jul 2001

posted posted 02-22-2003 21:11

I'm looking for a way to filter out one name in a mod_rewrite (index.php as it can create a loop). I've been trying various combinations and permutations and (thanks to TP) I think the closest is something like:

((index){0,0}[a-zA-Z_]+)

but this doesn't work. A negative lookbehind assertion would be the solution - like the negative lookahead assertion used here:
www.amk.ca/python/howto/regex/regex.html#SECTION000540000000000000000

and in that example they build a messy expression to exclude files ending in .bat and I suppose I could use something similar but I was wondering if anyone knew of a neat way to do this kind of thing?

[edit: I should add that there are various tricks I can possibly use to work around this but I was wondering about this specific solution]

___________________
Emps

FAQs: Emperor

butcher
Paranoid (IV) Inmate

From: New Jersey, USA
Insane since: Oct 2000

posted posted 02-22-2003 22:57

I don't know if mod_rewrite supports full PERL type regexps but if it does, Linear's answer in this post might be just the thing your loking for.

-Butcher-

Emperor
Maniac (V) Mad Scientist with Finglongers

From: Cell 53, East Wing
Insane since: Jul 2001

posted posted 02-22-2003 23:18

Butcher: Thanks for that but that uses a zero-width negative lookbehind (sorry I said lookback above) assertion and (as mentioned) that doesn't work in mod_rewrite and I was looking for a way of doing something similar.

___________________
Emps

FAQs: Emperor

Skaarjj
Maniac (V) Mad Scientist

From: :morF
Insane since: May 2000

posted posted 02-23-2003 08:34
quote:
zero-width negative loobechind

-- Emperor



It uses a what-now?

Emperor
Maniac (V) Mad Scientist with Finglongers

From: Cell 53, East Wing
Insane since: Jul 2001

posted posted 02-23-2003 14:54

Skaarjj: Sorry I was tired and my British love of toilets sneaked out

___________________
Emps

FAQs: Emperor

« BackwardsOnwards »

Show Forum Drop Down Menu