You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If possible, include a link to a program on play.golang.org.
1. http://play.golang.org/p/fm8TeCi6v3
What is the expected output?
probably "Qlah"
What do you see instead?
panic: runtime error: slice bounds out of range
goroutine 1 [running]:
regexp.(*Regexp).expand(0xf84004f080, 0xf84004d018, 0x300000003, 0x4b5071,
0x243e623c00000004, ...)
go/src/pkg/regexp/regexp.go:774 +0x507
regexp._func_001(0x7f27545cbf18, 0x7f27545cbf30, 0x7f27545cbf20, 0x427be5, 0x0, ...)
go/src/pkg/regexp/regexp.go:429 +0xab
regexp.(*Regexp).replaceAll(0xf84004f080, 0x0, 0x0, 0x4bc2cc, 0x7f2700000010, ...)
go/src/pkg/regexp/regexp.go:482 +0x471
regexp.(*Regexp).ReplaceAllString(0xf84004f080, 0x4bc2cc, 0xf800000010, 0x4b506c,
0x243e623c00000009, ...)
go/src/pkg/regexp/regexp.go:430 +0xe3
main.main()
/tmpfs/gosandbox-8e586ab1_5059905e_c3c129c6_e0de0f68_13ec3174/prog.go:13 +0xdb
Which compiler are you using (5g, 6g, 8g, gccgo)?
6g
Which operating system are you using?
Debian Squeeze x64
Which version are you using? (run 'go version')
1.0.3
Please provide any additional information below.
I believe this should not crash, instead $1 should get the value "". A single
unmatched capturing group "(x)" simply does nothing using ReplaceAllString,
putting it in an alternation "b|(x)" should not cause a panic. The panic only
occurs when the other element in the alternation matches.
The text was updated successfully, but these errors were encountered:
by myannikos:
The text was updated successfully, but these errors were encountered: