How to match empty lines with JavaScript regular expression
曾经蜡笔没有小新
曾经蜡笔没有小新 2017-05-19 10:45:34
0
2
626

I have a string as follows.

var str = `
   hello
   world 
   
   hi
   good
`;

There is a blank line between world and hi. I want to split the blank line to get an array. How to achieve this? Tried this and it didn't work.
str.split(/^\r|\r\n|\n$/);

曾经蜡笔没有小新
曾经蜡笔没有小新

reply all(2)
Peter_Zhu
var str = `
hello
world 

hi
good
`;
str.split(/\n\n|\r\r|\r\n\r\n/);
淡淡烟草味
var str = `
   hello
   world 
   
   hi
   good
`;

str.split(/\n\s*\n/g);
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template