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
+6.5k Golang : Handling image beyond OpenCV video capture boundary
+52.6k Golang : How to get struct field and value by name
+7.1k Golang : Transform lisp or spinal case to Pascal case example
+7.4k Golang : How to detect if a sentence ends with a punctuation?
+5.6k PHP : Convert CSV to JSON with YQL example
+18k Golang : How to log each HTTP request to your web server?
+5.8k Golang : Markov chains to predict probability of next state example
+7.2k CloudFlare : Another way to get visitor's real IP address
+9.4k Golang : Scramble and unscramble text message by randomly replacing words
+5.1k Golang : Display packages names during compilation
+12.7k Golang : Sort and reverse sort a slice of bytes
+11.8k Golang : convert(cast) float to string