Thursday, April 21, 2011

How can I exclude specific words from a generic regular expression?

Possible Duplicate:
Regular Expression to exclude set of Keywords

Hi,

I have the following regular expression which matches everything actually :-). However I need to exclude some specific strings from matching. I know I have to use the exclamation (!) sign, but I can't seem to get it working. Either way the strings don't get excluded or nothing is matched anymore....

This expression matches everything after the / of my domainname (including the trailing slash). I need to exclude /js and /style from rewriting. How can that be implemented in my expression?

^/(.*)$
From stackoverflow

0 comments:

Post a Comment