With refference to: [webmasterworld.com...]
adding backslash doesn't help too much!
(/\r\n/g); adding backslash (/\\r\\n/g); comes to (/\n/g);
backslash saved \n but not \r
So, how can I fix it?
Some script use backslash ( \ ), how can I keep it there?
Thanks
This is comparable statement in Perl:
$contents =~ s#(\r¦\n)#<br>#g;
I don't think so. It looks to me that the poster's regex is meant to match a Windows CRLF line ending. Some folks write that at \r\n but the peril there is that different platforms interpret \r and \n differently.
I find it more foolproof to use the octal ASCII characters, like so:
s/\015\012/<br>/gs;
Still, that makes for ugly HTML, so why not leave the newlines in after adding the <br>'s? And while you're at it, why not translate with Unix & Mac line endings?
s/((\015(\012)?)¦(\012))/<br>\015\012/gs;