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
+7k Golang : Levenshtein distance example
+11.9k Golang : Convert decimal number(integer) to IPv4 address
+10.6k Golang : Select region of interest with mouse click and crop from image
+19.8k Golang : Append content to a file
+15.8k Golang : Get digits from integer before and after given position example
+25.3k Golang : Get current file path of a file or executable
+14.5k Golang : How to determine if user agent is a mobile device example
+23.2k Golang : Print out struct values in string format
+33k Golang : How to check if a date is within certain range?
+19.2k Golang : Delete item from slice based on index/key position
+24k Golang : Find biggest/largest number in array
+30k Golang : How to declare kilobyte, megabyte, gigabyte, terabyte and so on?