正则表达式截取已字母开头,以数字结尾的字符串

1,632 阅读1分钟

今天朋友工作中问我这个问题,已经很久不写正则了,那就来记录下把!

        let a = '鸟fdsfdsG45aini大广高速'
        let b = /[a-zA-Z]+[\d]+/g
        a.replace(b, function (s, v) {
            console.log(s);
        })
        
        result= fdsfdsG45

试试把 可以举一反三