ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matthew Inger" <ma...@sedonacorp.com>
Subject RE: trouble with replaceregexp
Date Tue, 18 Jun 2002 17:25:21 GMT
This simply takes the exprtesssssion and passes it onto
the regular expression package, the only exception being
that it does some changing of the string for the substitution.
This was done by the ant guys, and they now are in charge
of this thing, so you might want to post your question
to the ant-dev newsgroup now.


-----Original Message-----
From: Lou Fox [mailto:loufox@cloud9.net]
Sent: Tuesday, June 18, 2002 12:43 PM
To: 'Ant Users List'
Subject: Re: trouble with replaceregexp


Thanks for the response.  Funny how we are thinking the same thing.  I know
it's not the smartest thing to do, but I too tested my logic using vim.
Anyway your suggestion of using $ and \n didn't help either, and according
to the documentation I shouldn't have to do that anyway since I'm using the
flags="s" parameter, which does the following:

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.

----- Original Message -----
From: "Dominique Devienne" <DDevienne@lgc.com>
To: "'Ant Users List'" <ant-user@jakarta.apache.org>
Sent: Tuesday, June 18, 2002 12:27 PM
Subject: RE: trouble with replaceregexp


> I don't know if <replaceregexp> works the same, but in vim, you need to
add
> the \n at the very end of the regex, otherwise the line remains empty:
>
> :%s/.*{$\n//g
>
> will remove all lines ending with an opening curly brace. If I do
>
> :%s/.*{$//g
>
> then the line remains (empty as I specified though). --DD
>
> PS: The command :g/{$/d also removes all such lines ;-)
>
> -----Original Message-----
> From: Lou Fox [mailto:loufox@cloud9.net]
> Sent: Tuesday, June 18, 2002 11:19 AM
> To: Ant Users List
> Subject: trouble with replaceregexp
>
> I would like to remove lines from a log file.  I'm able to remove all the
> text from lines that match my regex, however the an empty line remains for
> each of these matches.
>
> I'm using jdk1.4.0, and in my CLASSPATH I has
> D:\java\jakarta-oro-2.0.6\jakarta-oro-2.0.6.jar
>
>  <replaceregexp
>    byline="true"
>    flags="i,s"
>    match="^.*\.(gif|jpg|js|ram)\^.*"
>    replace="">
>    <fileset refid="unzippedfiles" />
>   </replaceregexp>
>
> Any suggestions?
>
> P.S. I also had a lot of trouble using doing negation searches.  For
> example, I was originally trying:
> ^.*\.[^(process|tem|htm|html)]\^.*$
>
> By a process of elimination I found that once [] was added, the results
> matches didn't seem to make sense.
>
>
> --
> To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>
>
> --
> To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>
>


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


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


Mime
View raw message