(.+) 默认是贪婪匹配,而(.+?)为惰性匹配
(.+)
(.+?)
const str = 'abcdabceba' str.match(/.+b/) // ['abcdabceb'] str.match(/.+?b/) // ['ab']
← call、apply、bind 继承 →