ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ivan Ivanov <>
Subject Re: stripping chars from property
Date Sat, 04 Jun 2005 14:45:20 GMT
Hello Henrik,

Here is one way to do this using ant-contrib[1] and
its task <propertyregex>[2]:

  <property name="ext.version" value="4.0.0"/>
  <propertyregex property="ext.version.undotted"
    regexp="\." replace=""/>
  <echo>$${ext.version.undotted} is

The output of this build file is:
[echo] ${ext.version.undotted} is 400.

There are also other ways to do it, like using
<scriptdef> and a scripting language like javascript
to do the string manipulation, but I think the one
above is the easiest.

HTH Ivan


--- Henrik Gemal <> wrote:

> I have the following:
> <property file="ext.version" value="4.0.0" />
> Now I need to create a file with the version in it's
> name but without 
> the . (dots) something like:
> So is there a way to convert the ${ext.version} into
> a new property 
> without the dots?
> I need this to be a generic way since I'm using the
> build.xml file in 
> different places
> To unsubscribe, e-mail:
> For additional commands, e-mail:

Discover Yahoo! 
Find restaurants, movies, travel and more fun for the weekend. Check it out! 

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message