You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-**Zero-alloc iterators** (`AllIndex`, `AppendAllIndex`) — 0 heap allocs, up to **30% faster** than FindAll. Email pattern **faster than Rust** with `AppendAllIndex`.
86
87
87
88
## Features
88
89
@@ -130,11 +131,28 @@ Supported methods:
130
131
### Zero-Allocation APIs
131
132
132
133
```go
133
-
// Zero allocations — returns bool
134
+
// Zero allocations — boolean match
134
135
matched:= re.IsMatch(text)
135
136
136
-
// Zero allocations — returns (start, end, found)
137
+
// Zero allocations — single match indices
137
138
start, end, found:= re.FindIndices(text)
139
+
140
+
// Zero allocations — iterator over all matches (Go 1.23+)
141
+
form:=range re.AllIndex(data) {
142
+
fmt.Printf("match at [%d, %d]\n", m[0], m[1])
143
+
}
144
+
145
+
// Zero allocations — match content iterator
146
+
fors:=range re.AllString(text) {
147
+
fmt.Println(s)
148
+
}
149
+
150
+
// Buffer-reuse — append to caller's slice (strconv.Append* pattern)
0 commit comments