你如何匹配ello w
字符串hello world
尝试此示例时遇到此错误
package main
import (
"fmt"
"regexp"
)
func check(result string ) string {
if (regexp.MatchString("b\\ello w\\b",result)) {
fmt.Println("Found it ")
return "True"
} else {
return "False"
}
}
func main() {
text := "Hello world "
check (text)
}
引发以下错误
# command-line-arguments
.\test.go:14:5: multiple-value regexp.MatchString() in single-value context
有只小跳蛙
catspeake
相关分类