Rewrote test for 'FindString()' to use lookarounds

implementBackreferences
Aadhavan Srinivasan 4 weeks ago
parent c803e45415
commit ab363e2766

@ -32,12 +32,12 @@ func ExampleReg_FindAll() {
}
func ExampleReg_FindString() {
regexStr := `\d+`
regexStr := `\w+\s+(?=sheep)`
regexComp := regex.MustCompile(regexStr)
matchStr := regexComp.FindString("The year is 2025")
matchStr := regexComp.FindString("pink cows and yellow sheep")
fmt.Println(matchStr)
// Output: 2025
// Output: yellow
}
func ExampleReg_FindSubmatch() {

Loading…
Cancel
Save