ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Reilly <peter.rei...@corvil.com>
Subject Re: AW: Backspace in regular expression
Date Wed, 23 Jun 2004 12:26:30 GMT
You could do:
      <substitution expression="${backspace} ${backspace}"/>

i.e backspace, space, backspace

Peter
Ivan Ivanov wrote:

>Hi Peter, I thinki that I started ver stubborn topic.
>
>--- Peter Reilly <peter.reilly@corvil.com> wrote:
>  
>
>>Ah, uou want the character backspace in the
>>resultant file?
>>Like:
>>tr[backspace]
>>gt[backspace]
>>so it looks like:
>>t
>>g
>>
>>    
>>
>
>Yes, that is right.
>  
>
>>I am not to sure how to do this with xml characters.
>>One can use
>><script> to set up a property with contain the
>>backspace character:
>>  <target name="replacebackspace">
>>    <script language="beanshell">
>>      project.setNewProperty("backspace", "\b");
>>    </script>
>>    <delete quiet="yes" file="x.txt"/>
>>    <concat destfile="x.txt">
>>aBACKSPACEbBACKSPACEc
>>    </concat>
>>    <replaceregexp flags="g" file="x.txt">
>>      <regexp pattern="BACKSPACE"/>
>>      <substitution expression="${backspace}"/>
>>    </replaceregexp>
>>    <concat><fileset file="x.txt"/></concat>
>>  </target>
>>
>>    
>>
>
>I tested it and it works like a charm. But can you
>make it work when the contents of x.txt is this
><concat destfile="x.txt">
>aBACKSPACE
>bBACKSPACE
>c
></concat>
>
>In my opinion it should output
><empty line>
><empty line>
>c
>but it outputs 
>a
>b
>c
>
>So there are too many abguities in my desire to
>replace expressions with backspace and you might
>abandon it.
>
>Thank you for your help.
>Regards Ivan
>
>
>	
>		
>__________________________________
>Do you Yahoo!?
>New and Improved Yahoo! Mail - 100MB free storage!
>http://promotions.yahoo.com/new_mail 
>
>---------------------------------------------------------------------
>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


Mime
View raw message