https://issues.apache.org/bugzilla/show_bug.cgi?id=54216
Bug ID: 54216
Summary: replaceregexp with backlash throws
StringIndexOutOfBoundsException
Product: Ant
Version: 1.8.3
Hardware: PC
Status: NEW
Severity: normal
Priority: P2
Component: Core tasks
Assignee: [email protected]
Reporter: [email protected]
Classification: Unclassified
The follwing ant code:
<replaceregexp file="FILE.EXT" match="hello" replace="\" />
When the regexp is applied against a file regardless of its name with the text
matching 'hello' or whichever the string is selected as the match, this
Exception will be thrown:
java.lang.StringIndexOutOfBoundsException: String index out of range: 1
It must have something to do with the backlash character escaping. The problem
disappears when applying a replace string escaped as follows:
<replaceregexp file="FILE.EXT" match="hello" replace="\\\\" />
In this case, the replacement is carried out successfully.
The bug won´t manifest itself when the text inside FILE.EXT does not match the
regular expression in the 'match' attribute.
--
You are receiving this mail because:
You are the assignee for the bug.