html textarea array 正则

      this.failIdsStr = ''
      if (this.currentStatus === 3) {
        this.failIdsCount = this.tmpData.invalid_ids_count + this.tmpData.repeat_ids_count
        let tmpStr = (this.tmpData.invalid_ids + ',' + this.tmpData.repeat_ids).split(',').filter(Boolean)
        if (tmpStr.length > 0) {
          this.failIdsStr= tmpStr.join('
')
        } 
      }
    changeMyTextarea(v) {
        let a = v.target.value
        let b = a.replace(/
/g, ',')
        let c = a.split(/[
]+/).join(',')

        let e = a
            .replace(/^[
suFEFFxA0]+|[
suFEFFxA0]+$/g, '')
            .split(/[
]+/)
            .map(e => e.trim())
            .filter(Boolean)
            .join(',')
        console.log('a is..
', a, '
b is ..
', b, '
cis ..', c, '
e is ..', e)
    },
原文地址:https://www.cnblogs.com/dhjy123/p/11891122.html