CountString returns the number of non-overlapping matches of the pattern in s. If n > 0, counts at most n matches. If n <= 0, counts all matches. Example: re := coregex.MustCompile(`\d+`) count := re.CountString("1 2 3 4 5", -1) // count == 5
(s string, n int)
| 1359 | // count := re.CountString("1 2 3 4 5", -1) |
| 1360 | // // count == 5 |
| 1361 | func (r *Regex) CountString(s string, n int) int { |
| 1362 | return r.engine.Count(stringToBytes(s), n) |
| 1363 | } |
| 1364 | |
| 1365 | // FindAllSubmatch returns a slice of all successive matches of the pattern in b, |
| 1366 | // where each match includes all capture groups. |