function endWith(str, endStr) {
                str = str.trim()
                let d = str.length - endStr.length
                return d >= 0 && str.lastIndexOf(endStr) == d
              }

 

let reg = /(.+(?=[<aaaa>]$))/
              console.log( 'a<aaaa>'), reg.test('<aaaa>'))

 

posted on 2022-03-17 22:53  阿梅M  阅读(1645)  评论(0编辑  收藏  举报