ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jakob Fix <jakob....@gmail.com>
Subject Re: <replaceregexp>
Date Thu, 20 Oct 2005 13:56:50 GMT
Mikael,

On 20/10/05, Mikael Petterson (KI/EAB) <mikael.petterson@ericsson.com> wrote:
> Hi,
>
> I am not quite confident how you mean? Can you please show me? And what is the meaning
of
>
> &#34;

This is a numeric (hexadecimal) entity representing the double quote
character.  You can use it to represent double quote characters inside
attribute values.

> I tried the following:
>
>  <target name="regexp_test">
>      <replaceregexp file="index.htm" match="^.*\( &#34;"CUSTOM_APPL_REV&#34;".*VALUE
=  &#34;"[A-Z0-9]&#34;"\)"   replace ="\1${product_number_html}\_${product_revision_html}"/>
>    </target>

try this:
<replaceregexp file="index.htm">
  <regexp pattern="^.*\(&#34;CUSTOM_APPL_REV&#34;*VALUE = 
&#34;[A-Z0-9]&#34;\)"/>
  <substitution
expression="\1${product_number_html}\_${product_revision_html}"/>
</replaceregexp>

I find <regexp/> and <substitution/> easier to read.

--
cheers,
Jakob.

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


Mime
View raw message