0
点赞
收藏
分享

微信扫一扫

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

人间四月天i 2022-03-18 阅读 65
htmlvue.js

                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 条评论