[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ant-user
Subject:    Using replaceregexp with a positive lookbehind regular expression
From:       "Anthony Bargnesi" <abargnesi () gmail ! com>
Date:       2008-05-01 16:44:56
Message-ID: bed0c1d30805010944s345f419fq52d86d75ef230b5e () mail ! gmail ! com
[Download RAW message or body]


Hello,

Here is the replaceregexp call:

<replaceregexp file="\\${host}/${config.remote.path}/${config.remote.file}"
replace="disabled = true">
    <regexp pattern="(?&lt;=\#\[SYD\-DATASOURCE\]\s)disabled\s=\sfalse" />
</replaceregexp>

As you can see I wrote the regular expression: *
(?&lt;=\#\[SYD\-DATASOURCE\]\s)disabled\s=\sfalse*

To match text like the following:

*......
(line break)
#[SYD-DATASOURCE]
disabled = false
......
......
*
When testing this regular expression out in a testing tool (Regex Creator) I
found that the positive lookbehind
matched *"disabled = false"* perfectly.

But ANT does not properly replace *"disabled = false" *with *"disabled =
true"*.  Is the &lt; throwing ANT
off or is there another reason why the positive lookbehind is failing?

Thanks in advance,
Tony


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic