ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 39050] New: - replaceregexp behaviour change between 154 and 165
Date Tue, 21 Mar 2006 17:22:30 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39050>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39050

           Summary: replaceregexp behaviour change between 154 and 165
           Product: Ant
           Version: 1.6.5
          Platform: All
        OS/Version: other
            Status: NEW
          Severity: regression
          Priority: P2
         Component: Optional Tasks
        AssignedTo: dev@ant.apache.org
        ReportedBy: conanc@ca.ibm.com


The following script ran fine with Ant 1.5.4 but failed with Ant 1.6.5
(Create a test.txt with 1 line "abcde")

<?xml version="1.0" encoding="UTF-8"?>
<project name="test" default="test" basedir="."> 
	<target name="test">
		<property name="regExp" value="^\s*abcde\s*$"/>
		<property name="replaceValue" value="abcde\\${abc}"/>
		<property name="file" value="test.txt"/>

		<echo>Replacing regular expression: ${regExp}, with 
${replaceValue}, in file ${file}</echo>
		
		<replaceregexp file="${file}"
			match="${regExp}"
			replace="${replaceValue}"
			byline="false"
			flags="m"/>
	</target>
</project>

Here is the problem I get when running with ANT 165.
test.xml:21: java.lang.IllegalArgumentException: Illegal group reference


I noticed that if I change the replaceValue from 
abcde\\${abc}
to
abcde${abc}
It run fine in Ant 165.

But if I made this change, the script won't run on ANT 154

Can you tell me why the behaviour has been changed?

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message