ExampleRegex_Find demonstrates finding the first match.
()
| 26 | |
| 27 | // ExampleRegex_Find demonstrates finding the first match. |
| 28 | func ExampleRegex_Find() { |
| 29 | re := coregex.MustCompile(`\d+`) |
| 30 | match := re.Find([]byte("age: 42 years")) |
| 31 | fmt.Println(string(match)) |
| 32 | // Output: 42 |
| 33 | } |
| 34 | |
| 35 | // ExampleRegex_FindString demonstrates finding a match in a string. |
| 36 | func ExampleRegex_FindString() { |
nothing calls this directly
no test coverage detected