expr := `^https://\w+@[a-z0-9]+.(com|net|org)$`
str := `https://qwerty123@heythere42.com`
res, err := rgx.Match(expr, str)
if err != nil {
fmt.Println(err)
}
fmt.Println(res.Matched)
fmt.Println(res.MatchStr)
output:
$ true
$ https://qwerty123@heythere42.com
WIth invalid input:
expr := `^\d{x}$`
str := `1234`
_, err := rgx.Match(expr, str)
if err != nil {
fmt.Print(err)
}
$ supplied value 'x' is not a number