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 21:53:17 GMT
On Tue, Oct 4, 2011 at 23:48, André Warnier <aw@ice-sa.com> wrote:
>>
>>> And, it seems that the Pattern class, and its own .matches()
>>> method, does work in the way that a non-exclusively-java programmer
>>> would expect, anchors and all.
>>
>> Does it?
>>
>
> Yes, because if one defines e.g. a Pattern "^abcdef" and uses it via
> yesno = Pattern.matches("^abcdef",input);
> it will actually match the pattern at the beginning of the string only,
> which is what one would expect.  Thus
>
> Pattern.matches("^abc","abcdef");
>
> would return true, while this :
>
> Pattern.compile("^abc").matcher("abcdef").matches()
>
> would return false (according to what I read in the documentation of
> Matcher.matches()).
> Not so ?
>
>>

Well, no, and here you see the incoherency of Java vocabulary vs the
rest of the regex world ;)

The Javadoc should really read "attempts to match the _whole_
input".

Bah. Too late to fix things...

-- 
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