ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Goktepe <andrewgokt...@gmail.com>
Subject Re: Issue using ReplaceRegExp
Date Tue, 08 Nov 2005 14:47:03 GMT
Remove the leading forward slash character in your pattern:
 <regexp pattern="\[java\] parts created:"/>
 -Andrew
 On 11/8/05, pritesh.saharey@wipro.com <pritesh.saharey@wipro.com> wrote:
>
>
> I tried using the pattern something like this;
>
> <target name="try-rep">
> <replaceregexp file="log.txt"
> byline="true">
>
> <regexp pattern="/\[java\] parts created" />
> <substitution expression="Size="/>
> </target>
> But I am seeing no changes in my log.txt file altough now I am not getting
> any error message and ant console output is showing me
>
> try-rep:
> [replaceregexp] Replacing pattern '/\[java\] parts created:' with 'Size='
> in 'D:\pvcsAnt\log.txt' by line.
>
> I am totally confused with this ReplaceRegExp
> Like to know does the changes will be reflected in the same file (i.e.
> log.txt) file, and I would be able to see "Size=11" instead of "[java]
> parts created:"?
>
> Can anyone give a snipet of code for this problem, I will be thankful to
> you.
>
> --Pritesh
>
>
> -----Original Message-----
> From: Jan.Materne@rzf.fin-nrw.de [mailto:Jan.Materne@rzf.fin-nrw.de]
> Sent: Friday, October 21, 2005 6:58 PM
> To: user@ant.apache.org
> Subject: AW: Issue using ReplaceRegExp
>
> Regexp could something around
> /.*parts created: (.*)$/\1
>
> But the "No supported regular expression matcher found" error message is
> more important.
> The matcher is part of JDK 1.4+, but because Ant is designed to run on JDK
> 1.2+ we have a word on library depenencies in the manual.
>
>
> Jan
>
>
> >-----Urspr√ľngliche Nachricht-----
> >Von: pritesh.saharey@wipro.com [mailto:pritesh.saharey@wipro.com]
> >Gesendet: Freitag, 21. Oktober 2005 15:09
> >An: user@ant.apache.org
> >Betreff: Issue using ReplaceRegExp
> >
> >
> >Hi All,
> > I am trying to use ReplaceRegExp but finding it difficult to
> >cope with it.
> >
> > There is a log.txt file generated from my build.xml using record task
> >which looks like this;
> > log.txt
> > -------
> > [java] Done!
> > [java]
> >
> > [java] bytes read: 111059499
> > [java] bytes written: 111059499
> > [java] parts created: 11
> > [java] time used: 46.562 sec.
> >
> >
> > Now I wanted to use the value of "parts created" which is "11"
> >but I am not able to use ReplaceRegExp properly
> >
> > It is giving me error message:
> >
> >
> > No supported regular expression matcher found
> >
> > I am using jdk1.3.1_11
> >
> >
> > I noticed one thing before [java] text there are 5spaces
> >
> > The whole idea is that I wanted to use this log.txt file as a property
> >file, which I am unable to, and as a
> >
> > Experiment I have done something like this in my build.xml file
> >
> > <target name="try-rep">
> > <replaceregexp file="log.txt"
> >
> > match="[java]"
> > replace="\0${insert}"
> > byline="true">
> > <!--
> > <regexp pattern="[java]" />
> > <substitution expression="\0"/>
> > -->
> > </replaceregexp>
> >
> > If I want to use this log.txt file as a property file than I
> >think I have to replace the strings till : (colon)
> >
> > Can anyone help me out?
> >
> > Wishes
> > Pritesh
> >
> >
> >
> >Confidentiality Notice
> >
> >
> >The information contained in this electronic message and any
> >attachments to this message are intended for the exclusive use of the
> >addressee(s) and may contain confidential or privileged information. If
> >you are not the intended recipient, please notify the sender at Wipro
> >or Mailadmin@wipro.com immediately and destroy all copies of this
> >message and any attachments.
> >
> >---------------------------------------------------------------------
> >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
>
>
>
>
> Confidentiality Notice
>
> The information contained in this electronic message and any attachments
> to this message are intended
> for the exclusive use of the addressee(s) and may contain confidential or
> privileged information. If
> you are not the intended recipient, please notify the sender at Wipro or
> Mailadmin@wipro.com immediately
> and destroy all copies of this message and any attachments.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>

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