I need help with a regular expression for use with UrlRewriting.Net. I have two URLs -
http://domain/SomeFolder/tracks/SomeFileName/
and
http://domain/SomeFolder/<could be anything>/SomeFileName/
For URL rewriting purposes I need to come up with one expression that will let me target specifically the URL with "tracks" in the middle of it. I need another expression to catch everything without "tracks" in it.
Before I had this constraint I was using ^~/SomeFolder/([^/]*)/SomeFileName/?$
and that worked as my catch-all. Now that I have this specific "tracks" folder, I can't use t开发者_C百科he catch all.
Make sense?
Many thanks for the help!
^~/SomeFolder/(?!tracks/)([^/]*)/SomeFileName/?$
and
^~/SomeFolder/(tracks)/SomeFileName/?$
精彩评论