Golang regexp.Match() function example
package regexp
Golang regexp.Match() function usage example
package main
import (
"fmt"
"regexp"
)
func main() {
// regular expression pattern
match, err := regexp.Match("/oid/([\\d]+)/", []byte("/oid/1/"))
if err != nil {
fmt.Println(err)
}
fmt.Println("Matched ? : ", match)
}
Output :
Matched ? : true
Reference :
Advertisement
Something interesting
Tutorials
+5.6k Golang : Configure crontab to poll every two minutes 8am to 6pm Monday to Friday
+12.6k Golang : flag provided but not defined error
+6.9k Mac/Linux/Windows : Get CPU information from command line
+8.8k Golang : Accept any number of function arguments with three dots(...)
+7k Web : How to see your website from different countries?
+80.7k Golang : How to return HTTP status code?
+5.3k Golang : Get FX sentiment from website example
+6.5k Golang : Map within a map example
+8.8k Golang : Gorilla web tool kit schema example
+30.4k Golang : How to redirect to new page with net/http?
+8.4k Golang : Generate Datamatrix barcode
+5.6k Swift : Get substring with rangeOfString() function example