diff --git a/text/gregex/gregex_z_example_test.go b/text/gregex/gregex_z_example_test.go index 789751444..afcefbe37 100644 --- a/text/gregex/gregex_z_example_test.go +++ b/text/gregex/gregex_z_example_test.go @@ -7,6 +7,7 @@ package gregex_test import ( "bytes" + "fmt" "strings" "github.com/gogf/gf/v2/frame/g" @@ -119,10 +120,10 @@ func ExampleMatchAllString() { func ExampleQuote() { result := gregex.Quote(`[1-9]\d+`) - g.Dump(result) + fmt.Println(result) // Output: - // "\[1-9\]\\d\+" + // \[1-9\]\\d\+ } func ExampleReplace() { @@ -268,14 +269,11 @@ func ExampleSplit() { func ExampleValidate() { // Valid match statement - g.Dump(gregex.Validate(`\d+`)) + fmt.Println(gregex.Validate(`\d+`)) // Mismatched statement - g.Dump(gregex.Validate(`[a-9]\d+`)) + fmt.Println(gregex.Validate(`[a-9]\d+`)) // Output: // - // { - // Code: "invalid character class range", - // Expr: "a-9", - // } + // error parsing regexp: invalid character class range: `a-9` }