From 4e15b5f43484e753f58541fe054362688543e546 Mon Sep 17 00:00:00 2001 From: Stephane Bailliez Date: Wed, 30 Jan 2002 21:32:08 +0000 Subject: [PATCH] Add a note to users so that they are aware of this cross platform problem for line terminator and the differences between regular expressions libraries. git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@271013 13f79535-47bb-0310-9956-ffa450edef68 --- docs/manual/OptionalTasks/replaceregexp.html | 26 ++++++++++++++++---- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/docs/manual/OptionalTasks/replaceregexp.html b/docs/manual/OptionalTasks/replaceregexp.html index 03ae488fa..176805a99 100644 --- a/docs/manual/OptionalTasks/replaceregexp.html +++ b/docs/manual/OptionalTasks/replaceregexp.html @@ -17,11 +17,27 @@ in a selected file or set of files.

type mappers this task needs a supporting regular expression library and an implementation of org.apache.tools.ant.util.regexp.Regexp. Ant comes with -implementations for -the java.util.regex package of JDK 1.4, -jakarta-regexp +implementations for +the java.util.regex package of JDK 1.4, +jakarta-regexp and jakarta-ORO, but you will still need the library itself.

+

+ +There are cross-platform issues for matches related to line terminator. +For example if you use $ to anchor your regular expression on the end of a line +the results might be very different depending on both your platform and the regular +expression library you use. It is 'highly recommended' to tests your pattern on +Unix and Windows platforms before you rely on it. +

+It is strongly recommended to use Jakarta Oro. + +

Parameters

@@ -67,7 +83,7 @@ but you will still need the library itself.

Examples

-
  <replaceregexp file="${src}/build.properties" 
+
  <replaceregexp file="${src}/build.properties"
                          match="OldProperty=(.*)"
                          replace="NewProperty=\1"
                          byline="true" />
@@ -76,7 +92,7 @@ but you will still need the library itself.

with "NewProperty" in a properties file, preserving the existing value, in the file ${src}/build.properties

Parameters specified as nested elements

-

This task supports a nested FileSet +

This task supports a nested FileSet element.

This task supports a nested RegularExpression element to specify the regular expression. You can use this element to refer to a previously