Have you looked at the AntContrib tasks?
http://ant-contrib.sourceforge.net/tasks/tasks/propertyregex.html
This one should do the trick. Of course, you'll have to install the
antContrib.jar and put a taskref in your build.xml, but this should
work.
On Jan 8, 2008 7:57 PM, DJ Kingsolver <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I need to do a simple string manipulation, but I'm finding it harder than I
> expected.
>
> Say I have a property like this:
> <property name="inputString" value="foo/bar/baz" />
>
> I'd like to set another property like this:
> <property name="outputString" value="${inputString (with '/' replaced with
> '_')}" />
>
> So, <echo message="${outputString}" /> would write "[echo] foo_bar_baz"
>
> What is a good way to achieve this?
>
> I've thought about writing inputString to a file and replacing the '/' with
> '_' using <replace>, then reading the changed value back out of the file.
> But I'd rather not have the overhead of writing to a file.
>
> Thanks for your help,
> DJ
>
--
--
David Weintraub
[EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]