为什么使用regexp无法进行前向断言
img src="http://www.baidu.com/a.jpg"
r, _ := regexp.Compile(`(?=img src=").+jpg`)
为啥吗报错呢。。runtime错误
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x74 pc=0x8895d]
goroutine 1 [running]:
sync/atomic.CompareAndSwapUint32()
/usr/local/go/src/pkg/sync/atomic/asm_amd64.s:14 +0xd
sync.(*Mutex).Lock(0x74)
/usr/local/go/src/pkg/sync/mutex.go:43 +0x35
regexp.(*Regexp).get(0x0, 0x101c81e8)
/usr/local/go/src/pkg/regexp/regexp.go:178 +0x2a
regexp.(*Regexp).doExecute(0x0, 0x0, 0x0, 0x210235000, 0x62, ...)
/usr/local/go/src/pkg/regexp/exec.go:323 +0x35
regexp.(*Regexp).Find(0x0, 0x210235000, 0x62, 0x62, 0x210237000, ...)
/usr/local/go/src/pkg/regexp/regexp.go:653 +0x80
main.MatchImage()
/Users/whispermemory/Desktop/testimgsrc.go:23 +0x109
main.main()
/Users/whispermemory/Desktop/testimgsrc.go:28 +0x18