I am trying to match on any incoming requests that don't have a trailing slash. I also want to capture the URL path, to use in a capture group. Here is what I've gotten so far.
Incoming URL: http://www.example.com/path/to/
Regex: http:\/\/www.example.com\/(.*)[.\/]
Here's a link to the regex tester results
This captures what I want, but it always matches on all URLs - not the URLs that don't contain a trailing slash.
The regex processor is PERL based.
What do I need to change?
http:\/\/www.example.com\/(.*)$(?<!\/)
will work. - Wiktor Stribiżew