in reply to Converting carriage returns to HTML breaks

split() the string using a regex that looks for [\n\r]{1,2} then join() the string using <br/> as the separator.
  • Comment on Re: Converting carriage returns to HTML breaks

Replies are listed 'Best First'.
Re^2: Converting carriage returns to HTML breaks
by AnomalousMonk (Archbishop) on Apr 16, 2012 at 15:27 UTC

    I think that should be  [\n\r]{1,2} and  '<br/>' and whether it will actually work is another question.