.replaceAll("\n","<br/>") does not work

.replaceAll("\n","<br/>") does not work

To add line breaks or carriage returns to an HTML view of a multi-line field, I tried this solution:
<td><%=record.item2_1.replaceAll("\n","<br/>")%></td>

but got this error message
Error details: Error in executing full_view view script.Error.Error in executing For Each Record task.Error in executing Html Content task.Error evaluating STRING expression :Error evaluating STRING expression :Error evaluating STRING expression :Error evaluating STRING expression :

Would really appreciate your help. Many thanks in advance!