Skip to content

Commit

Permalink
add StrictMatchingScheme example
Browse files Browse the repository at this point in the history
  • Loading branch information
mvdan committed Jan 1, 2024
1 parent 6e48432 commit 7f5546e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,13 @@ func Example() {
// http://golang.org
// [foo.com http://foo.com/]
}

func ExampleStrictMatchingScheme() {
rx, err := xurls.StrictMatchingScheme(`https?://`)
if err != nil {
panic(err)
}
fmt.Println(rx.FindAllString("Download binaries via https://foo.com/dl or ftps://foo.com/dl", -1))
// Output:
// [https://foo.com/dl]
}

0 comments on commit 7f5546e

Please sign in to comment.