On Fri, 2003-07-18 at 13:33, [EMAIL PROTECTED] wrote:
>
> Maybe <replaceregexp> could do the job.
> http://ant.apache.org/manual/OptionalTasks/replaceregexp.html
>
> Something like
>
> <loadfile property="text" srcFile="insertedText"/>
> <replaceregexp
> file="theFile"
> match="(.*)(textafterthis)(.*)"
> replace="\1\2$text\3"
> />
>
You do not need the .* at the start and end of
the match expression.
Also there may be need to match on a new-line, so
the flags should be set to "s" (I think).
<property name="location"
value="sometext${line.separator}"/>
<replaceregexp
file="test.txt"
flags="s"
match="(${location})"
replace="\1${text}"/>
Peter
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]