ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Olivier Gies <olivier.g...@bull.net>
Subject Re: replaceregexp Question
Date Wed, 20 Feb 2008 03:05:21 GMT
You should use <replaceregexp flags="g" ... /> in order to replace all 
occurences, or use combination of flags described below, as taken 
directly from Ant user manual 
(http://ant.apache.org/manual/OptionalTasks/replaceregexp.html):

    flags

    The flags to use when matching the regular expression. For more 
information, consult the Perl5 syntax
    g : Global replacement. Replace all occurrences found
    i : Case Insensitive. Do not consider case in the match
    m : Multiline. Treat the string as multiple lines of input, using 
"^" and "$" as the start or end of any line, respectively, rather than 
start or end of string.
    s : Singleline. Treat the string as a single line of input, using 
"." to match any character, including a newline, which normally, it 
would not match.

Olivier
-------- Original Message  --------
Subject: replaceregexp Question
From: Z W <mpc8250@gmail.com>
To: Ant Users List <user@ant.apache.org>
Date: 20/02/2008 02:56
> Hi
>
> My understanding is that 1 replacement is possible with replaceregexp.
> Eg. below
>
> <replaceregexp file="${app}/install_data"
>
> match="fix"
>
> replace="sunfix"
>
> byline="true"/>
>
> Question:
>
> Can <replaceregexp> allow multiple matches and replacements in a
> single <replaceregexp>,
> instead of one match at a time ?
>
> thanks
>
>   

-- 

*Olivier Gies*

*Delivery Manager
Customs & Tax Software Engineering Center
Bull, Architect of an Open World ^TM
Phone: +86 (10) 65978001 - Ext 555 *

*www.bull.com <http://www.bull.com/>*

*This e-mail contains material that is confidential for the sole use of 
the intended recipient. Any review, reliance or distribution by others 
or forwarding without express permission is strictly prohibited. If you 
are not the intended recipient, please contact the sender and delete all 
copies.*


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