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
+13.3k Golang : Linear algebra and matrix calculation example
+27.9k Golang : Decode/unmarshal unknown JSON data type with map[string]interface
+27.6k PHP : Convert(cast) string to bigInt
+21.9k Golang : Use TLS version 1.2 and enforce server security configuration over client
+22.5k Golang : Convert Unix timestamp to UTC timestamp
+17.4k Golang : Check if IP address is version 4 or 6
+6.9k Default cipher that OpenSSL used to encrypt a PEM file
+5k Golang : Constant and variable names in native language
+8.2k Golang : Qt splash screen with delay example
+12.7k Golang : zlib compress file example
+13.7k Golang : Image to ASCII art example