qqxu
2/23/2018 - 8:49 AM

string split with regex for chinese symbol ——

string split with regex for chinese symbol ——

中文破折号分割字符串 如:

当时轻别意中人,山长水远知何处——晏殊《踏莎行·碧海无波》

  const REGEX = /(—{2})/;
  let arr = data.split(REGEX);