Ticket #208 (reopened defect)
ReplaceRegexp problem with newline as replace string
| Reported by: | dthomas | Owned by: | hans |
|---|---|---|---|
| Priority: | major | Milestone: | TBD |
| Component: | phing-core | Version: | 2.3.0 |
| Keywords: | Cc: |
Description
The documentation of the ReflexiveTask contains the following example:
<reflexive>
<fileset ... />
<filterchain><replaceregexp>
<regexp pattern="\n\r" replace="\n"/>
</replaceregexp>
</filterchain>
</reflexive>
But the modified files contain the string "\n" instead of the expected newline.
PS: shouldn't the pattern be "\r\n" instead for windows?
Attachments
Change History
comment:2 Changed 8 months ago by michaelze
- Status changed from closed to reopened
- Resolution fixed deleted
I know this is a very old ticket, but in my opinion, this issue is not resolved.
I think the intention of the OP was not to hint the small mistake in the documentation but to point out that newlines in the replace attribute of the <regexp /> element do not appear as newlines in the replaced text but as the two characters "\" and "n".
Although this issue is over 3 years old, this still exists in v2.4.5.

Fixed in r346, thanks!