[go-nuts] regexp question

2023-02-10 Thread Jochen Voss
Dear all, What happens if a group in a regular expression matches repeatedly, via the * operator? Experimentally I found that FindStringSubmatch then returns the text of the last match. Is this guaranteed somewhere (I didn't find anything about this on https://pkg.go.dev/regexp )? Also, is t

[go-nuts] Regexp question

2016-08-16 Thread Jan Mercl
This code (A) package main import ( "fmt" "regexp" ) func main() { fmt.Printf("%v", regexp.MustCompile(`a*`).FindAllStringIndex(`baaab`, -1)) } (https://play.golang.org/p/WeyStT0Gbn) Produces [[0 0