ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ivan \"Rambius\" Ivanov" <rambiusparkisan...@yahoo.com>
Subject Re: Ant task to replace special characters
Date Tue, 28 Mar 2006 22:25:27 GMT
Hello,

There is <propertyregex> task in ant-contrib that
takes a "string" (or a value of a property) as input
and (re)set a property with the new value. I
personally do not use it. Instead, I use the following
trick (the reg exp in it is untested):

<property name="foo.bar" value="foo.bar(1).memory"/>
<echo file=".temfile">${foo.bar}</echo>
<replaceregexp>
  <regexp pattern="\(1\)"/>
  <substitution expression="_1"/>
</replaceregexp>
<delete file=".tempfile"/>

Regards
Ivan

--- Thod Nguyen <tng713@yahoo.com> wrote:

> Thanks Ivan. 
> 
> it seems that both <replace> or <replaceregexp>
> requires a file as an input. In my case, i just want
> to     format the string with some replaceable
> token(s). 
> 
> --- "Ivan \"Rambius\" Ivanov"
> <rambiusparkisanius@yahoo.com> wrote:
> 
> > Hello,
> > 
> > Perhaps you need <replace> or <replaceregexp>
> tasks.
> > 
> > Regards
> > Ivan
> > 
> > --- Thod Nguyen <tng713@yahoo.com> wrote:
> > 
> > > is there a simple way in build.xml to replace
> for
> > > instance, a filename foo.bar(1).memory with
> > > foo.bar_1.memory using one of the existing Ant
> > task
> > > ?
> > > 
> > > Thanks
> > > T.N.
> > > 
> > >
> __________________________________________________
> > > Do You Yahoo!?
> > > Tired of spam?  Yahoo! Mail has the best spam
> > > protection around 
> > > http://mail.yahoo.com 
> > > 
> > >
> >
>
---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> > > user-unsubscribe@ant.apache.org
> > > For additional commands, e-mail:
> > > user-help@ant.apache.org
> > > 
> > > 
> > 
> > 
> > __________________________________________________
> > Do You Yahoo!?
> > Tired of spam?  Yahoo! Mail has the best spam
> > protection around 
> > http://mail.yahoo.com 
> > 
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > user-unsubscribe@ant.apache.org
> > For additional commands, e-mail:
> > user-help@ant.apache.org
> > 
> > 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam
> protection around 
> http://mail.yahoo.com 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@ant.apache.org
> For additional commands, e-mail:
> user-help@ant.apache.org
> 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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


Mime
View raw message