Skip to content

API overview ​

The v3.2 API returns original-text UTF-16 ranges. Choose the smallest result shape your task needs.

NeedMethod
Every match or lazy resultssearch / iterate
Presence, totals, per-entry countsmatch / count / countByPattern
Replace or split textreplace / tokenize
Select, filter, restrict a rangeSearchOptions / QueryOptions
Persist a compiled dictionaryserialize / deserialize
Inspect compiled storagegetStats

Constructor ​

Read the focused reference →

search(text, options?) ​

Read the focused reference →

match(text, options?) ​

Read the focused reference →

count(text, options?) ​

Read the focused reference →

countByPattern(text, options?) ​

Read the focused reference →

iterate(text, options?) ​

Read the focused reference →

replace(text, replacement, options?) ​

Read the focused reference →

Private state ​

Read the focused reference →

Whole-word matching ​

Read the focused reference →

Compiled dictionaries ​

Read the focused reference →

createStream(options?) ​

Read the focused reference →

Optional normalization and case folding ​

Read the focused reference →

MIT · Based on BrunoRB/ahocorasick