开发者

IE8 regexp finding newline characters

开发者 https://www.devze.com 2023-02-02 08:44 出处:网络
I\'m using javascript regexp to replace newline characters with html paragraphs. In FireFox, Safari and Chrome I have no problem, but in IE8 it fails to 开发者_如何学运维find any newline characters at

I'm using javascript regexp to replace newline characters with html paragraphs. In FireFox, Safari and Chrome I have no problem, but in IE8 it fails to 开发者_如何学运维find any newline characters at all. I have tried both /\n/g and /\r\n/ but without success. Has anyone else had a similar problem?


Some things you could try:

/[\012\015]+/
/[\x0A\x0D]+/
/[\r\n]+/
/(\012|\015)+/
/(\x0A|\x0D)+/
/(\r|\n)+/
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号