可以解释为什么匹配play?golang regexp.matchString有什么问题?
来源:
package main
import "fmt"
import "regexp"
func main() {
match, _ := regexp.MatchString("[a-z]+", "test?")
fmt.Printf("the result of match: %v", match)
}
不是golang的regexp.MatchString
完全匹配?我不明白,我是golang的新手
*不是golang的regexp.MatchString完全匹配吗?*不,它不是。 –
有没有完全匹配的功能? – toolchainX
只需在表达式中添加锚点:'^ [a-z] + $' –