You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by peter reilly <pe...@corvil.com> on 2003/04/02 08:49:10 UTC

Re: Substituting in CRLF in ReplaceRegExp

The \n does not get interpreted by xml. You
need to use  a property like this:
      <substitution expression="foo ${line.separator} bar"/>
Peter.

On Wednesday 02 April 2003 08:24, William Ferguson wrote:
> I'm having trouble insrting CRLF via ReplaceRegExp.
> It just seems to entirely ignore the "\n" in the substituion expression.
> I've tried prefixing with multiple back slashes but to no avail.
> Using Ant 1.5, JDK 1.4.1 and the ORO mapper.
>
> <replaceregexp flags="s">
>    <regexp pattern="somepatternThatMatches"/>
>    <substitution expression="foo \n bar"/>
>    <fileset dir="${test.dir}">
>       <include name="**/*.java"/>
>    </fileset>
> </replaceregexp>
>
> Any ideas?
>
>
> William Ferguson
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org


RE: Substituting in CRLF in ReplaceRegExp

Posted by William Ferguson <wi...@versata.com.au>.
Many thanks Peter.

-----Original Message-----
From: peter reilly [mailto:peter.reilly@corvil.com]
Sent: Wednesday, April 02, 2003 4:49 PM
To: Ant Users List
Subject: Re: Substituting in CRLF in ReplaceRegExp


The \n does not get interpreted by xml. You
need to use  a property like this:
      <substitution expression="foo ${line.separator} bar"/>
Peter.

On Wednesday 02 April 2003 08:24, William Ferguson wrote:
> I'm having trouble insrting CRLF via ReplaceRegExp.
> It just seems to entirely ignore the "\n" in the substituion expression.
> I've tried prefixing with multiple back slashes but to no avail.
> Using Ant 1.5, JDK 1.4.1 and the ORO mapper.
>
> <replaceregexp flags="s">
>    <regexp pattern="somepatternThatMatches"/>
>    <substitution expression="foo \n bar"/>
>    <fileset dir="${test.dir}">
>       <include name="**/*.java"/>
>    </fileset>
> </replaceregexp>
>
> Any ideas?
>
>
> William Ferguson
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org


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