ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marc van Grootel (Mendez Nederland)" <Marc.van.Groo...@mendez.nl>
Subject RE: Regular Expression for Enhanced Replace Task
Date Mon, 10 Sep 2001 13:12:08 GMT
Hi,

Thanks for this task, I was looking for something like that.
My Java programming knowledge is minimal and I don't know
the Regexp package very well but I was under the impression
that I could use backreferences in the replacement value
(value attribute) so that I could do something like:

  <target name="foo">
      <regreplace basedir="${basedir}"
                  filename="foo.txt" 
                  regexp="(foo)(bar)"
                  value="foo\1"/>
  </target>

Alas, the value is used literally so "foobar" gives "foo\1" instead
of "foofoo".
Is this intentional, or could this be added?

Cheers,

--Marc

> -----Original Message-----
> From: Herry [mailto:herrykoh@yahoo.com]
> Sent: Sunday, September 09, 2001 7:11 PM
> To: ant-user@jakarta.apache.org
> Subject: Regular Expression for Enhanced Replace Task
> 
> 
> Hi all,
> I have been working on a little personal project to
> enhance the current 'replace' task with regular
> expression, please find below the URL links to my
> source and binary files ( apologies about the cheesy
> website as tbis is my hobby, therefore, I am using a
> non-commercial i.e. free website hosting service :)  )
> http://herrykoh.topcities.com/projects/index.html
> 
> Please note that since I am using the Jakarta's Regexp
> package for the regular expression parsing, you will
> have to include the RegExp from the Jakarta Apache's
> website in order to use this task
> 
> Just go to the RegReplace section to download the
> source and binary and examples.
> 
> Since this is not a default task, you will need to use
> taskdef to define this task (see examples on the site)
> 
> Please let me know if you have any comments
> 
> Cheers,
> Herry.
> 
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Y! Pages - Search or browse for business listings.
> http://yp.yahoo.com.sg/
> 

Mime
View raw message