Active TopicsActive Topics  Display List of Forum MembersMemberlist  HelpHelp   RegisterRegister  LoginLogin
ISAPI_Rewrite 2.x support forum
 Helicon Tech : ISAPI_Rewrite 2.x support forum
Subject Topic: Not matching a file in a specific folder Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
jferris
Newbie
Newbie


Joined: 28 February 2007
Location: United States
Online Status: Offline
Posts: 3
Posted: 10 October 2008 at 1:50pm | IP Logged Quote jferris

Greetings,

I am hoping that somone can help me with a regex for a rule that has been driving me crazy.  The requirement for the rule is simple.  Assume that there is a page called result.aspx.  What I am trying to do is find a match for any time that result.aspx is present in the URL and is not immediately following a specific folder.  Assume that result.aspx should live in a folder called "/search/".

So, for example:

/search/result.aspx (no match)
/anything/result.aspx (match)
/something/result.aspx (match)

The problem is that I can't just look for "something" and "anything" because there is an unknown combination of them.  So, the rule is basically, "If result.aspx is present and it is not present in the form of /search/result.aspx, then match".

I hope that I have explained this clearly.  Any help would be greatly appreciated!  I swear that I have tried every combination of lookarounds, lookbehinds, and lookaheads that I can come up with.

Thanks in advance,

Joseph

Back to Top View jferris's Profile Search for other posts by jferris
 
Lexey
Moderator Group
Moderator Group


Joined: 15 August 2002
Location: Russian Federation
Online Status: Offline
Posts: 7559
Posted: 14 October 2008 at 1:15pm | IP Logged Quote Lexey

Possible expressions are:

(?!.*/search/result\.aspx).*/result\.aspx.*

.*(?<!/search)/result\.aspx.*
Back to Top View Lexey's Profile Search for other posts by Lexey
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum