Reputation: 10478
I am trying to construct a regular expression that will match the following URL:
www.mydomain.com/testPhrase
but NOT match
www.mydomain.com/directory/stuff/morestuff/testPhrase/index.aspx?blah=foo
for an IIS URL Rewrite Rule.
I started with ^.*testPhrase
but that matches both. What is the regex syntax to say only match if there is nothing after testPhrase but there can be anything before it?
Upvotes: 0
Views: 158
Reputation: 441
Why not use ^.*testPhrase$ - that would ensure that testPhrase is always at the very end.
Upvotes: 3