Go语言 正则


原文链接: Go语言 正则

sudo apt-get install libonig-dev

import "rubex"

rxp := rubex.MustCompile("[a-z]*")
if err != nil {
    // whoops
}
result := rxp.FindString("a me my")
if result != "" {
    // FOUND A STRING!! YAY! Must be "a" in this instance
} else {
    // no good
}
`