redhotpenguin has asked for the wisdom of the Perl Monks concerning the following question:
Monks
I'm using ProxyRemoteMatch directive in mod_proxy, and the httpd docs say that Apache's regular expression library is a subset of Perls. I am trying to generate a regular expression to not match a set of words, i.e. not match any expressions that represent images such as "foo.jpg" or "bar.gif".
Normally, I would use negative match with alternation such as !~ m/(some|words)/;, but I can't do that here. My latest attempt has used a zero-width negative lookbehind assertion:
to not match any urls ending in .gif or .jpe|g that were followed by "imagename" (\w+ in the regex). I've been through the perlre man page, perlretut, but I need to ask for help at this point. I don't know the extent of the subset of Perl's regex engine that is implemented in Apache, but any suggestions here on alternative regex formulations would be most appreciated.\w+\.(?!gif)(?!jpe?g)$
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Negative expressions with alternation in ProxyRemoteMatch
by Roger (Parson) on Aug 30, 2005 at 06:50 UTC | |
by redhotpenguin (Deacon) on Aug 30, 2005 at 07:21 UTC | |
by Roger (Parson) on Aug 30, 2005 at 08:58 UTC | |
|
Re: Negative expressions with alternation in ProxyRemoteMatch
by josera (Beadle) on Aug 30, 2005 at 07:14 UTC |