diff --git a/regex/example_test.go b/regex/example_test.go index 913518c..4f868c6 100644 --- a/regex/example_test.go +++ b/regex/example_test.go @@ -154,3 +154,11 @@ func ExampleReg_Longest() { // Output: x // xx } + +func ExampleReg_ReplaceAll() { + regexStr := `(\d)(\w)` + inputStr := "5d9t" + regexComp := regex.MustCompile(regexStr) + fmt.Println(regexComp.ReplaceAll(inputStr, `$2$1`)) + // Output: d5t9 +}