Jean Luc
2010-09-16 22:24:17 UTC
Target match = http://www.domain.com/groups OR http://www.domain.com/groups/
The regex does not need to contain domain text so lets throw that away:
Target match = /groups OR /groups/
So, if I created a simple regex "/groups" it could match against:
/groups
/groups/
/groups/page
/page/groups/page
So thats no good. Somehow the regex needs to obey the following exactly:
string must directly follow the domain extension and not be a sub page:
.com/groups = good
.com/page/groups = bad
string can contain a trailing slash
.com/groups = good
.com/groups/ = good
after the trailing slash, no additional directories can exist:
.com/groups = good
.com/groups/ = good
.com/groups/page/ = bad
BUT query string are allowed:
.com/groups?var=data = good
.com/groups/?var=data = good
Can anyone help me formulate a regex to accomplish this? Please I have an insain deadline. TYVM!!!
Robert