ant-regexp  
Author Message
debitsudo





PostPosted: 2004-11-4 18:53:00 Top

java-programmer, ant-regexp I would like to use the following regexp:
<replaceregexp flags="g" match="\n\[\s&&[^\n]]+" replace="\\\\n">
<fileset dir="/home/public/dbs/regexp"
includes="applicationLogMessages.properties"/>
</replaceregexp>

unfortunately, eclipse marks this as an error as soon as i type a "&".

my goal is to replace all NEWLINEs where the new line starts with a
WHITESPACE with a \n, but keep it on the same line.
if the next line is empty(simply a NEWLINE) i want to do nothing!

how can i achieve this (without using &)?

thankful for all hints.
david
 
Michael Borgwardt





PostPosted: 2004-11-4 19:01:00 Top

java-programmer >> ant-regexp david wrote:

> I would like to use the following regexp:
> <replaceregexp flags="g" match="\n\[\s&&[^\n]]+" replace="\\\\n">
> <fileset dir="/home/public/dbs/regexp"
> includes="applicationLogMessages.properties"/>
> </replaceregexp>
>
> unfortunately, eclipse marks this as an error as soon as i type a "&".

Ant scripts are XML, and & must be escaped with an entity & in XML.