Thanks. This did the trick. -----Original Message----- From: Jeffrey E Care [mailto:[EMAIL PROTECTED] Sent: Monday, October 10, 2005 6:09 PM To: Ant Users List Subject: Re: splitting a string
I think AntContrib's <propertyregex> task could do this. -- Jeffrey E. Care ([EMAIL PROTECTED]) WebSphere v7 Release Engineer WebSphere Build Tooling Lead (Project Mantis) "Lasher, James L" <[EMAIL PROTECTED]> 10/10/2005 07:43 PM Please respond to "Ant Users List" To "Ant Users List" <user@ant.apache.org> cc Subject splitting a string Hello all, I'm hoping someone here could help me with an idea on how to take a property and "split" it into two (additional) properties. My specific situation is that I have a property that has a value of [0-9][0-9].[0-9][0-9].[0-9][0-9][0-9]. I would like to split this so that I end up with one new property whose value is the beginning of the original property string ([0-9][0-9].[0-9][0-9]) and the second whose value would be the last set of [0-9][0-9][0-9]. I currently have the original property defined in a file (/tmp/refverprops) which looks like: ReferenceVersionMinor=02.10.555 I've figured out a way to get the second property value which in my example will be ReferenceVersionMinor by doing the following: <loadproperties srcfile="/tmp/refverprops"> <filterchain> <linecontains> <contains value="ReferenceVersionMinor"/> </linecontains> <tokenfilter> <replaceregex pattern="[0-9][0-9]\.[0-9][0-9]\." replace=""/> </tokenfilter> </filterchain> This will give me a property name/value of ReferenceVersionMinor/555 I can't figure out though how to do something similar to get the first property value of: 02.10 (without a trailing dot after 10). I could whip up a custom task to do this for me, but would prefer to use what's already available in Ant, if I can find what that might be. Can anyone help? -jim- --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]