Thanks for looking at that.
What I mean on that part is that in the url below... I'd want the a= and the p= to be stripped from the querystring... as the a= & p= would be found in the match. but the x= remains intact and get passed back through the rewrite...
http://www.cbengine.net/1234/comments/?a=graphs&x=1&p=5678
In this next example I'd only want the p= to be removed from the querystring. The a= is not present in the match, so the already present a= gets put in it's place.
http://www.cbengine.net/1234/?a=graphs&x=1&p=5678
Basically the p= will always need to be stripped form the querystring if present. Then I just some checks in place to make sure duplicate values are not getting passed around like I explained on that page.
Sort of an "either/or but not both" kind of thing... if that makes any sense? Sorry if it doesn't, I feel like I'm loosing my mind.