我有
的javascript字符串变量var sttr="We prefer questions that can be answered --------------------- not just discussed ---------------------
Provide details ---------------------------- Write clearly and simply --------------------------answer all the question"
请建议如何在短划线的基础上将字符串拆分为句子数组(-----)使用正则表达式
结果应该是
array[0]=We prefer questions that can be answered
array[1]=not just discussed
array[2]=Provide details
array[3]=rite clearly and simply
array[4]=answer all the question
注意:每个句子介于10到50之间的短划线(-----)范围
答案 0 :(得分:1)
您希望拆分/-{10,50}/g
。
答案 1 :(得分:0)
sttr.split(/ - + /克);
进行测试