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
http://play.golang.org/p/sgdJPamWRd
package main
import "regexp"
var r1 = regexp.MustCompile("x{0,3}")
var r2 = regexp.MustCompile("x{,3}")
func main() {
println(r1.MatchString(""), r2.MatchString(""))
}
prints 'true false' but I expected 'true true'.
It is entirely possible that I have forgotten what x{,3} means,
but I thought it meant x{0,3}. It is not listed on
http://code.google.com/p/re2/wiki/Syntax, so maybe
it should be a syntax error?
The text was updated successfully, but these errors were encountered:
Regexps do not allow writing {,n} for {0,n},
but there are no syntax errors in { } operations.
Something that doesn't fit the syntax is treated
as literal text, so x{,n} is the same as x\{,n\}.
So the program is working as "intended".
The text was updated successfully, but these errors were encountered: