Forum Moderators: phranque

Message Too Old, No Replies

regexp match rules

...once again!

         

PsychoTekk

8:00 am on Jul 10, 2002 (gmt 0)

10+ Year Member



okay, i need some help with the syntax for matching
a regular expression in an url / an url path.
the syntax is similar to the mod_rewrite stuff, e.g.:
acl targetlist url_regex -i www.taget-site.net
(where url_regex is the rewriteCond and www.target-site.net the rewriteRule)
looking at all the threads about mod_rewrite and engelschall's faq
i still don't know how to use all those $'s, ^'s and (.*)$'s :(

what do i have to do to define an exact match for just www.target-site.net
as the domainname?
what to match www.target-site.net?
and finally to match
www.example.net/blah/exp/blah.htm?

thanks in advance!

PsychoTekk

8:44 am on Jul 10, 2002 (gmt 0)

10+ Year Member



okay i found the mistake, the reason why my rules
even matched the most unrelated expressions
was that i had a comment at the end of one of the lines
(though the default settings have this,too :o)

jdMorgan

9:50 pm on Jul 10, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



PsychoTekk,

I dug this up last night while working a regex problem:

[etext.lib.virginia.edu...]

Not real in-depth, but useful and covers a few more regex points than the
excerpt in Engelschall's mod_rewrite documentation... If a site search here
doesn't turn up what you need, try Google using "regular expressions
regex" :)

Jim

PsychoTekk

10:06 pm on Jul 10, 2002 (gmt 0)

10+ Year Member



thanks that's a very useful guide!
i tried to write a blocklist that covers 600+ ads and banner servers
just using any match or matches at the beginning of a line...
pretty difficult - i will have a closer look at the guide the next days
and then hopefully be able to write a short and effective blocklist :)