'18589096794'.replace(/.(?=.{4})/g, '*') 输出:*******6794'18589096794'.replace(/(?<=.{3}).(?=.{4})/g, '*') 输出:185****6794