亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

How to match empty lines with JavaScript regular expression
曾經(jīng)蠟筆沒有小新
曾經(jīng)蠟筆沒有小新 2017-05-19 10:45:34
0
2
683

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$/);

曾經(jīng)蠟筆沒有小新
曾經(jīng)蠟筆沒有小新

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