-
Regex match string1 but not string2 - help please
Its probably really easy, but I have not been able to crack this one.
I need a regex for AWStats that will match in the URL /blog but not /feed. I can match every occurrence of /blog or every line that does not contain /feed, but not both together.
e.g.
/blog/category/uebgrsekbgisuebgr/erthsrth/4/ WILL match
/blog/feed/atom will NOT match
/blog/2007/05/13 WILL match
/blog/feed will NOT match
/blog WILL match
So far I have:
But that's not matching anything.
I have been using Regulazy to build and test my regex, as well as testing within AWStats.
Please could somebody help me with this expression.
Thanks in advance
Tim
-
I'm not great at regex, so forgive me if this is buggy. It works with all the scenarios you gave though:
Code:
/blog/?([^(feed)]{4}).*
Hope that at least gets you on the right track
-Saj
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules