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
+4.3k Golang : Converting individual Jawi alphabet to Rumi(Romanized) alphabet example
+17.2k Google Chrome : Your connection to website is encrypted with obsolete cryptography
+10.6k Golang : How to unmarshal JSON inner/nested value and assign to specific struct?
+12.8k Golang : Convert int(year) to time.Time type
+12.4k Golang : Search and extract certain XML data example
+12.3k Golang : Display list of countries and ISO codes
+5.4k Golang : Reclaim memory occupied by make() example
+12k Golang : Convert a rune to unicode style string \u
+18.6k Golang : Iterating Elements Over A List
+12.2k Golang : Simple client-server HMAC authentication without SSL example
+31.7k Golang : How to convert(cast) string to IP address?