On 18/01/12 17:46, Nehal Patel wrote:
Nice, this was the solution!
Frankly this is a bit more advanced that i know.
I don't know the following:
What the "^" means.
What the "$" means.
What the "\1" means.
All you want to know about regular expressions and even more:
http://www.regular-expr
: Harold Putman [mailto:hput...@lexmark.com]
Sent: 18 January 2012 19:51
To: Ant Users List
Subject: Re: Update property value in file and retaining format.
These are Regular Expression "metacharacters"
^ means start of line
$ means end of line
\1 is a "backreference" used i
at should preserve "test2" and
> > all the tabs around it, while still replacing the bit you actually want
> to
> > change, which is whatever comes after the = sign.
> >
> > HTH!
> >
> >
> > -Original Message-
> > From: Nehal Pate
--Original Message-
> From: Nehal Patel [mailto:nehalhpatel...@gmail.com]
> Sent: 13 January 2012 23:01
> To: user@ant.apache.org
> Subject: Update property value in file and retaining format.
>
> Hello,
> Having an problem updating the value of in a
[mailto:nehalhpatel...@gmail.com]
Sent: 13 January 2012 23:01
To: user@ant.apache.org
Subject: Update property value in file and retaining format.
Hello,
Having an problem updating the value of in a property file and
retaining the format. For example i have the following
stuff.properties:
t
Hello,
Having an problem updating the value of in a property file and
retaining the format. For example i have the following
stuff.properties:
test1 =aaa
test2 =bbb
test3 =ccc
I run the following:
I get the following:
test1 =aaa
test2=