]> Cypherpunks repositories - gostls13.git/commitdiff
exp/norm: reverting to using strings.Repeat, as it doesn't look like exp/regexp
authorMarcel van Lohuizen <mpvl@golang.org>
Fri, 16 Sep 2011 09:28:53 +0000 (11:28 +0200)
committerMarcel van Lohuizen <mpvl@golang.org>
Fri, 16 Sep 2011 09:28:53 +0000 (11:28 +0200)
is going to support returning multiple matches for a single repeated group.

R=r, rsc, mpvl
CC=golang-dev
https://golang.org/cl/5014045

src/pkg/exp/norm/normregtest.go

index 2a0f3a65cc0246b5c779c05d73d7ad1dd41bcda4..b2d8b1ffd7c84c6342d8f0bdc71e382d1b1a6fcd 100644 (file)
@@ -115,8 +115,7 @@ func (t Test) Name() string {
 }
 
 var partRe = regexp.MustCompile(`@Part(\d) # (.*)\n`) // TODO: using $ iso \n does not work
-// TODO: the following regexp does not work: `^(?:([\dA-F ]+);){5} # (.*)\n`
-var testRe = regexp.MustCompile(`^(?:([\dA-F ]+);)(?:([\dA-F ]+);)(?:([\dA-F ]+);)(?:([\dA-F ]+);)(?:([\dA-F ]+);) # (.*)\n`)
+var testRe = regexp.MustCompile(`^` + strings.Repeat(`([\dA-F ]+);`, 5) + ` # (.*)\n`)
 
 var counter int