ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From luis.cone...@ge.com
Subject backslash and CRLF in regular expression [was: Backspace in regul ar expression]
Date Tue, 22 Jun 2004 22:43:05 GMT
Hi all,

	It turns out that I have these files that have several lines like
following:

blablabla blabla bla \
blablabla blabla bla \
blablabla blabla bla;

and I want to make a single line like:

blablabla blabla bla blablabla blabla bla blablabla blabla bla;

I have tried this:

    <target name="replace">
        <replaceregexp byline="true" file="myfile">
	    <regexp pattern="\\&#13;&#10;"/>
          <substitution expression=""/>
         </replaceregexp>
    </target>

Also, I've used as value for <regexp pattern> following:

<regexp pattern="\\ &#10;&#13;"/>
<regexp pattern="\\&#10;&#13;"/>
<regexp pattern="\\&#10;"/>
<regexp pattern="\\&#13;"/>
<regexp pattern="\\ \n\r"/>
<regexp pattern="\\ \r\n"/>
<regexp pattern="\\\n\r"/>
<regexp pattern="\\\r\n"/>
<regexp pattern="\\\n"/>
<regexp pattern="\\\r"/>

Any ideas out there? I am running out of them right now.

Appreciate your help on this issue

Regards.
Luis

-----Original Message-----
From: Oliver Ashoff [mailto:Oliver.Ashoff@xtramind.com]
Sent: Tuesday, June 22, 2004 10:59 AM
To: Ant Users List
Subject: AW: Backspace in regular expression



Try 
    &#8;
instead of 
    \b
In general, the expression 
    #&<decnum>;
encodes any character where
<decnum> is a number in decimal notation.

Works fine with LINE FEED: #&10;

Oliver 

> -----Urspr√ľngliche Nachricht-----
> Von: Ivan Ivanov [mailto:rambiusparkisanius@yahoo.com] 
> Gesendet: Dienstag, 22. Juni 2004 12:02
> An: user@ant.apache.org
> Betreff: Backspace in regular expression
> 
> 
> Dear Colleagues,
> 
> I want to replace a string in a file with backspace,
> but I do not know how to escape backspace literal
> "\b". I tried
> <replaceregexp byline="true" file="myfile">
>     <regexp pattern="alabala"/>
>     <substitution expression="\b"/>
> </replaceregexp>
> 
> but it replace "alabala" with letter "b" and some
> other variants but with no success.
> 
> 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

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


Mime
View raw message