diff --git a/manual/Tasks/replaceregexp.html b/manual/Tasks/replaceregexp.html index 9d1276d09..eed4c84c4 100644 --- a/manual/Tasks/replaceregexp.html +++ b/manual/Tasks/replaceregexp.html @@ -126,7 +126,10 @@ value, in the file ${src}/build.properties

<substitution id="id" expression="beta\1alpha"/>
<substitution refid="id"/> + +

Examples

+
 <replaceregexp byline="true">
@@ -141,6 +144,7 @@ value, in the file ${src}/build.properties

with "NewProperty" in a properties file, preserving the existing value, in all files ending in .properties in the current directory

+
<replaceregexp match="\s+" replace=" " flags="g" byline="true">
     <fileset dir="${html.dir}" includes="**/*.html"/>
@@ -148,7 +152,6 @@ value, in all files ending in .properties in the current directory<
 

replaces all whitespaces (blanks, tabs, etc) by one blank remaining the line separator. So with input -

 <html>    <body>
@@ -156,13 +159,47 @@ line separator. So with input
 <<TAB>> </body></html>
 
would converted to +
 <html> <body>
  <h1> T E S T </h1> </body></html>
 
+
+

+ +
+
+
<replaceregexp match="\\n" replace="${line.separator}" flags="g" byline="true">
+    <fileset dir="${dir}"/>
+</replaceregexp>
+
+

replaces all \n markers (beware the quoting of the backslash) by a line break. +So with input +

+
+one\ntwo\nthree
+
+would converted to +
+
+one
+two
+three
+
+
+Beware that inserting line breaks could break file syntax. For example in xml: +
+
+<root>
+  <text>line breaks \n should work in text</text>
+  <attribute value="but breaks \n attributes" />
+</root>
+
+

+