判断 20字符 中文加标点 最少两个中文字符

阅读 65

2022-03-18

                var reg=/[a-zA-Z0-9]+/;
                var regg=/([\u4e00-\u9fa5])/g;
                if(!reg.test(this.capitalInput)&&this.capitalInput.length<21&&[...this.capitalInput.matchAll(regg)].length >= 2){
                    console.log(this.capitalInput.length)
                    this.desc_divsw=false;                   
                }else{
                    console.log("你真棒")
                    this.desc_divsw=true;
                
                }

精彩评论(0)

0 0 举报