|
|
@@ -1253,8 +1253,9 @@ let cbParser = {
|
|
|
},
|
|
|
//获取表达式中的中文式
|
|
|
getCN: function (expr) {
|
|
|
- //let cnRex = /\d*[\u4e00-\u9fa5]{1,}\({0,}[\u4e00-\u9fa5]{0,}\*?\d*%*、?[\u4e00-\u9fa5]{0,}\){0,}[\u4e00-\u9fa5]{0,}/g;
|
|
|
- let cnRex = /\d*[\u4e00-\u9fa5]{1,}\({0,}[\u4e00-\u9fa5]{0,}\*?\d*%*、?[\u4e00-\u9fa5]{0,}\){0,}[\u4e00-\u9fa5]{0,}\(?[\u4e00-\u9fa5]{0,}\)?/g;
|
|
|
+ // let cnRex = /\d*[\u4e00-\u9fa5]{1,}\({0,}[\u4e00-\u9fa5]{0,}\*?\d*%*、?[\u4e00-\u9fa5]{0,}\){0,}[\u4e00-\u9fa5]{0,}\(?[\u4e00-\u9fa5]{0,}\)?/g;
|
|
|
+ // 支持{}内的:多个顿号、小括号、中文括号。
|
|
|
+ let cnRex = /\d*[\u4e00-\u9fa5]{1,}\({0,}([\u4e00-\u9fa5]{0,}\*?\d*%*、?)+[\u4e00-\u9fa5]{0,}\){0,}[\u4e00-\u9fa5]{0,}\(?[\u4e00-\u9fa5]{0,}\)?/g;
|
|
|
return _.filter(expr.match(cnRex), function (data) {
|
|
|
return data;
|
|
|
});
|