ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Winton <greg.win...@gmail.com>
Subject Re: <replaceregexp>
Date Sun, 23 Oct 2005 17:30:12 GMT
> I am trying:
>
> <replaceregexp file="index.htm">
> <regexp pattern="\(*&#34;CUSTOM_APPL_REV&#34; VALUE =
&#34;[A-Z0-9]&#34;\)"/>
> <substitution expression="\1 kalle"/>
> </replaceregexp>
>
> but still no match.

Change "[A-Z0-9]" to "[A-Z0-9]+". Also, your parentheses are still such that
you will be appending "&quot;kalle&quot;" to the entire string. You can
simplify the logic a bit since the first part of the match will not change.

<replaceregexp file="index.htm">
<regexp pattern="#34;CUSTOM_APPL
>
> _REV&#34; VALUE = &#34;[A-Z0-9]&#34;\)"/>
> <substitution expression="#34;CUSTOM_APPL
> >
> > _REV&#34; VALUE =&#34;kalle&#34"/>
>
>  </replaceregexp>
>

This could be further clarrified by putting everything up to
"&#34;kalle&#34" into a property.

This is untested but should work.

Greg

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message