tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Konstantin Kolinko <knst.koli...@gmail.com>
Subject Re: tomcat 7.0.21: bug in RemoteAddrValve?
Date Thu, 15 Sep 2011 12:55:52 GMT
2011/9/15 André Warnier <aw@ice-sa.com>:
> Konstantin Kolinko wrote:
>>
>> 2011/9/15 André Warnier <aw@ice-sa.com>:
>>>
>>> On the other hand, using a regexp provides for quite a bit of flexibility
>>> regarding ranges of addresses. You could use something like :
>>> "(127\\.0\\.0\\.1)|((0?:0?:0?:0?:0?:0?)?:0?:1)"
>>
>> Just 127\.0\.0\.1
>> It is XML - no need to double the slashes.
>
> For XML parsing not.  But then it becomes a String, and this String is
> passed to the regexp engine..
> And the regexp engine will interpret "." as "any character", while it
> interprets "\." as "a dot character".
> So, are you sure ?

String needs double "\" when it is written in Java sources or in
properties files. Double slash becomes single slash when the class is
compiled or when the properties file is read.

When it is in memory it does not need the double slashes.


Best regards,
Konstantin Kolinko

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


Mime
View raw message