tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Francis GALIEGUE <...@one2team.com>
Subject Re: Denying IPs using the Valve command in context.xml
Date Tue, 04 Oct 2011 19:44:30 GMT
On Tue, Oct 4, 2011 at 21:40, André Warnier <aw@ice-sa.com> wrote:
[...]
>>
> I am not sure that I follow the depths of the Java implementation of all of
> this, but please note that "\.googlebot\.com$" is a regexp /anchored/ at the
> end of the string.
> In other words, I would be surprised (and disappointed) if this did not
> match the hostnames "bot1.googlebot.com" and "bot123.bots.googlebot.com"

It's quite simple really: .matches(), which is used, anchors the regex
at the beginning and end. .matches("re") is equivalent to
.lookingAt("^re$"), even if your re is already anchored.

Unfortunately, this method's misleading name and the prevalence of
Java has led a lot of people to believe that regex matching was done
on the whole input, which is of course false.

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
fge@one2team.com
40 avenue Raymond Poincaré
75116 Paris

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message