commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oliver Heger <heg...@med.uni-marburg.de>
Subject Re: [Re: [configuration] specify a regular expression as string property]
Date Thu, 22 Apr 2004 09:16:36 GMT
If you use a properties file, you will have to double the backslash so 
that it is recognized by java.util.Properties. Single backslashes are 
interpreted as the beginning of an escape sequence. So you should have 
something like
biz.objects.brand.regex=.{0\\,30}

Have a look at the JavaDocs for the load() method of 
java.util.Properties. (I ran in the same trouble once when I tried to 
define windows pathes in properties files.)

Oliver

T E Schmitz schrieb:

> Sorry guys, that doesn't work either :-(
> 
> I had tried that before; and tried it again:
> 
> biz.objects.brand.regex=.{0\,30}
> Object o = config.getProperty("biz.objects.brand.regex");
> logger.info ("REGEX " + o + " " + o.getClass());
> 
> Message: REGEX [.{0, 30}] class java.util.ArrayList
> 
> 
> Regards,
> 
> Tarlika
> 
> 
> Oliver Heger wrote:
> 
>> Yes, you are right. A backslash should do the trick.
>>
>> Tatu Vanhanen schrieb:
>>
>>> The PropertiesTokenizer lets you escape commas with a backslash 
>>> ('\'). So
>>> the getString() should return a regular expression string with the 
>>> commas,
>>> right?
>>>
>>> So have you tried
>>> first.name.pattern=.{0\,30}
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>>>
>>>
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message