ExampleRegex_FindString demonstrates finding a match in a string.
()
| 34 | |
| 35 | // ExampleRegex_FindString demonstrates finding a match in a string. |
| 36 | func ExampleRegex_FindString() { |
| 37 | re := coregex.MustCompile(`\w+@\w+\.\w+`) |
| 38 | email := re.FindString("Contact: user@example.com") |
| 39 | fmt.Println(email) |
| 40 | // Output: user@example.com |
| 41 | } |
| 42 | |
| 43 | // ExampleRegex_FindIndex demonstrates finding match positions. |
| 44 | func ExampleRegex_FindIndex() { |
nothing calls this directly
no test coverage detected