我想在节点中使用句号分割段落,但在分割之前我还需要检查一些例外情况。对于Ex,我想使用"分割以下段落。"但它不应该影响包含网站名称或电子邮件ID或括号()中的语句的语句。
My Country is best country in the world.My country name is India. This country belongs to several states.each state has different users which are using website named www.google.com or www.facebook.com. My state named Maharashtra uses email Id starting with dummy@gmail.com.
有人可以帮我吗?
答案 0 :(得分:1)
试试这个RegExp
var newContent = content.replace(/([.?!])\s*(?=[A-Z])/g, "$1|").split("|");