Is there a Regex guru in here ?
I tried to find the answer, I got close on that one : Matching strings not ending with .html but unfortunately, it doesn't fulfill my need :
On IIS 7.5 want to redirect any address without trailing slash :
- catalog
- catalog/chapter
to
- catalog/chapter/
but not
- catalog/
- catalog/chapter/
- catalog/chapter/anything.any
- catalog/chapter/anything.any4
- catalog/chapter/anything.an
(extension between 2 and 4 char)
Tricky part is, I need to get that first group "catalog" as it's used in the conditions to check if it exists in rewrite tables. For now, I'm getting that first group with : ((.+?)(?=/|$))
But then, to check the following (if there's any), I'm stuck.
I can't figure how to do it...
Thanks a bunch for your help !!!
EDIT :
To be clearer, this is what I'm looking to achieve :
- catalog ==> MATCH + captures "catalog" in group 1
- catalog/chapter ==> MATCH + captures "catalog" in group 1
- catalog/ ==> NO MATCH
- catalog/chapter/ ==> NO MATCH
- catalog/chapter/anything.any ==> NO MATCH
- catalog/chapter/anything.any4 ==> NO MATCH
- catalog/chapter/anything.an ==> NO MATCH