看下面例子:

var re = /^([^]*?)aaa([^]*)$/
re.exec('aaa')
// [ 'aaa', '', '', index: 0, input: 'aaa', groups: undefined ]
re.exec('b  bbaaaa  b')
// [ 'aaaa', 'b  bb', 'a   ', index: 0, input: 'aaaa', groups: undefined ]

由此可以看出[^]就是相当于通配符`.`,([^]*)表示匹配任意长度的字符,并且为获取匹配