From ab363e2766d8fdcf5e99037af88f8dc5a0f7edcc Mon Sep 17 00:00:00 2001 From: Aadhavan Srinivasan Date: Mon, 10 Feb 2025 09:24:47 -0500 Subject: [PATCH] Rewrote test for 'FindString()' to use lookarounds --- regex/example_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/regex/example_test.go b/regex/example_test.go index 2360a03..913518c 100644 --- a/regex/example_test.go +++ b/regex/example_test.go @@ -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() {