Reputation: 1456
I've been able to pattern-match a url with or without a trailing slash
<match url="locations/(.+?)/?$" />
However, I want to be able to match locations/[location]/index.aspx as well.
How can I incorporate this optional pattern?
I tried the clumsy:
<match url="(towns/(.+?)/?$)|(towns/(.+?)/index\.aspx$)" />
which wasn't liked at all!
Any help would be appreciated.
Upvotes: 0
Views: 83
Reputation: 3549
This
(?<=locations\/)(.+?)(?=\/|$|\s)
will match [location] in
/locations/[location]/
/locations/[location]
/locations/[location]/index.aspx
/locations/[location]/anything_on_the_planet.html
/locations/[location] <A bunch of text over here>
If I am understanding your question right you want -
If you need anything else, let me know
Upvotes: 1