正则匹配多行任意字符

([\w\W]*)

例子:

const str= `
pages: [
      'a',
      'b',
      'c'
],
windows: {
}
`
str.replace(/([\w\W]*)/,'any')

参考:https://www.jianshu.com/p/ff05d467e145

posted @ 2020-10-22 10:51  _fn  阅读(1978)  评论(0编辑  收藏  举报