match
match: (
buffer?,searchBuffer?,options?) =>object
Defined in: utils/buffers/match.js:31
Searches for all occurrences of searchBuffer in buffer using KMP.
Parameters
Section titled “Parameters”buffer?
Section titled “buffer?”any = ...
The buffer to search within
searchBuffer?
Section titled “searchBuffer?”any
The byte pattern to search for
options?
Section titled “options?”KMP search options
limit?
Section titled “limit?”number = Infinity
Maximum matches to return
lookup?
Section titled “lookup?”number[]
Pre-computed KMP failure function table
partial?
Section titled “partial?”number = 0
KMP partial match state from a prior chunk
Returns
Section titled “Returns”object
- Match result with indices, partial state, and lookup table
lookup
Section titled “lookup”lookup:
number[]
matches
Section titled “matches”matches:
number[]
partial
Section titled “partial”partial:
number