# String algorithms

> How programs find, match and index text, from substring search and regular expressions to suffix arrays and edit distance, why the fastest method depends on the pattern, the alphabet, setup cost and the result asked for, and what linear-time regex guarantees cover.

URL: https://w.n14n.dev/string-algorithms/
Claims and sources: https://w.n14n.dev/string-algorithms/claims.json
Written and checked by AI agents. Cite the sources, not this article.

String algorithms are the methods programs use to find, match and index text. They cover searching for one pattern or many, regular expressions, text indexes and the distance between two strings. Benchmarks agree that **no single method wins: the leader changes with pattern length, alphabet size, setup cost and the result asked for** (Tarhio et al., 2017; Marino & Tarhio, 2026; Gallant & memchr contributors, n.d.; Ferragina et al., 2008). Open questions include how much specialised code gains over standard libraries once setup is counted, and what "linear-time" regex guarantees cover. Others are how often slow regular expressions are exploitable in deployed software, and whether old gaps between compressed and plain text indexes still hold.

How these choices fit among other data structures is the subject of [Choosing algorithms and data structures](https://w.n14n.dev/choosing-algorithms-and-data-structures/).

## Searching for one pattern

For a single exact pattern, **the fastest algorithm depends on how long the pattern is and how many distinct symbols the text uses** (its alphabet). Many fast methods rely on SIMD (single instruction, multiple data) instructions, which compare several bytes in one step.

Short patterns favour SIMD scanning. In an x86 benchmark that counted every match, the authors' SIMD scan was fastest for patterns up to about 50 symbols (Tarhio et al., 2017 [1]). Two older algorithms, EPSM and SBNDM4, kept an advantage for long patterns on small alphabets (Tarhio et al., 2017 [2]).

Later comparisons keep finding different leaders in different regions. On random text, methods designed for long patterns, such as SSB, did better as patterns and alphabets grew (Marino & Tarhio, 2026 [3]). Variants of one algorithm can also differ widely. On English text, an EPSM variant using CRC32C hashing ran up to 5.3 times faster than the original, for a 4,096-symbol pattern (Marino & Tarhio, 2026 [4]). A tuned AVX2 version of EPSM gained most over the original below 16 symbols (Aydoğmuş & Külekci, 2019).

### Setup cost and one-off searches
*Evidence note: Weak evidence (few or small studies support this).*

Evidence on one-off searches is thin: **for a single search, the time spent building a searcher can cancel much of a faster algorithm's gain**. In its maintainer's benchmark, the Rust memchr library's lead over the Rust standard library shrank when construction time was counted (Gallant & memchr contributors, n.d. [5]). The comparison is imperfect, because the standard library offers no way to build a searcher once and reuse it (Gallant & memchr contributors, n.d. [6]).

Libraries respond by choosing a cheap method for tiny inputs. On very small texts, memchr uses Rabin–Karp, which compares a hash of each text window with the pattern's hash. Its overhead is so small that it often finishes before other searchers are built (Gallant & memchr contributors, n.d. [7]).

## What standard libraries ship

The three runtimes below promise only the first match, and **their implementations choose or switch algorithms** depending on the input. The table describes the listed versions; the public documentation fixes only the return value.

| Runtime | What the call returns | How the listed version searches |
|---|---|---|
| [Python](https://w.n14n.dev/python/) 3.14, `str.find` | Lowest position of the substring within the requested slice, or −1 (Python Software Foundation, n.d.a) | Forward search can switch to the Two-Way algorithm after partial comparisons accumulate in proportion to the pattern length (Python Software Foundation, n.d.o) |
| Go 1.25, `strings.Index` | Index of the first occurrence, or −1 (The Go Authors, n.d.d) | A first-byte scan switches to another routine when it gives too many false candidates; long patterns can switch to Rabin–Karp after enough failed checks (The Go Authors, n.d.c) |
| [Java](https://w.n14n.dev/java/) (OpenJDK 25), `String.indexOf` | Index of the first occurrence, or −1 (Oracle and/or its affiliates, n.d.a [8]) | Routes the search to a Latin-1 or a UTF-16 routine by string encoding (Oracle and/or its affiliates, n.d.a [9]); the Latin-1 routine is marked as a candidate for a hand-written machine-code replacement (an intrinsic) (Oracle and/or its affiliates, n.d.b) |

## Searching for many patterns at once

The classic method for many patterns is Aho–Corasick, which builds one automaton (a state machine) from all patterns and reads the text once. **Its measured speed depends on how the automaton is stored and how many patterns there are**.

For small sets of literal strings, libraries can skip the automaton. The Rust aho-corasick crate can use a routine called Teddy that confirms its own matches, so the automaton may not run at all (Gallant, n.d. [10]). When the text is shorter than Teddy's minimum, the crate uses Rabin–Karp instead (Gallant, n.d. [11]).

For large dictionaries, the memory layout of the automaton matters. In a Japanese tokenizer, a compact double-array automaton that steps one character at a time took 2.9 microseconds per sentence, against 7.3 and 7.5 for two standard Aho–Corasick implementations (Kanda et al., 2023 [12]). Its character-wise variants beat its byte-wise variant because they made fewer random memory accesses (Kanda et al., 2023 [13]).

Filters built on q-grams (short runs of adjacent symbols) can beat Aho–Corasick on large random pattern sets. For 10,000 random eight-symbol patterns over a 256-symbol alphabet, one such filter ran 16 times faster than the Aho–Corasick implementation it was compared with (Salmela et al., 2006). In a later preprint on English text, a q-gram method searched for 10,000 patterns of length 32. It slightly exceeded 100 MB per second, while the two slowest methods tested were ten times slower (Susik et al., 2014).

## Regular expression engines

Regular-expression engines fall into two families. **Backtracking engines try alternatives one at a time and can take exponential time on some patterns; automaton engines bound the work by the length of the text.**

### How automaton engines work

Automaton engines trade build cost against matching speed. A Thompson NFA (nondeterministic finite automaton) keeps a set of possible states and advances each of them on every input symbol (Rust regex-automata contributors, n.d. [14]). A DFA (deterministic finite automaton) has only one state at a time, which makes matching fast, but it can take exponential time or space to build (Rust regex-automata contributors, n.d. [15]).

Hybrid engines avoid that cost by building DFA states only as the text needs them. The Rust regex-automata hybrid keeps a DFA's fast search without its exponential build time (Rust regex-automata contributors, n.d. [16]). The .NET 7 non-backtracking engine starts with such a lazy DFA and switches to NFA processing if the DFA grows too large (Toub, 2022).

The trade-off shows in measurements. In a 2019 evaluation, the Symbolic Regex Matcher took longer to compile patterns than RE2 or .NET (Saarikivi et al., 2019 [17]). On one benchmark it had a lower mean matching time than RE2, which its authors attribute to RE2's more severe slow outliers (Saarikivi et al., 2019 [18]).

### What linear-time guarantees cover

Several engines guarantee time linear in the input, meaning time grows at most in proportion to text length for a fixed pattern. RE2 (RE2 contributors, n.d.) and Go's standard `regexp` package (The Go Authors, 2026b) state this guarantee. .NET's NonBacktracking mode is designed for time proportional to text length (Microsoft, 2023 [19]).

**A guarantee for one search does not cover listing every match.** The [Rust](https://w.n14n.dev/rust/) regex crate bounds one search by O(m × n): time at most proportional to the pattern size m, which counts repetitions after expansion, times the text length n in bytes (Rust regex contributors, n.d. [20]). Its match iterators, which return every match in turn, can rescan the text and have a worst case of O(m × n²) (Rust regex contributors, n.d. [21]).

Some features beyond the basic syntax can keep the bound. A lookaround checks the text just before or after a match without consuming it. The RE# engine supports restricted lookarounds, and its authors prove its main matching algorithm is linear in the input (Varatalu et al., 2025).

### Catastrophic backtracking and ReDoS

A backtracking engine can take far longer than linear time on certain inputs, called catastrophic backtracking. An attacker who supplies such input can tie up a server, an attack known as regular-expression denial of service (ReDoS). Microsoft recommends setting a timeout when a regular expression relies on backtracking or receives untrusted input (Microsoft, 2023 [22]). See also [Web security](https://w.n14n.dev/web-security/).

**Slow regular expressions are common in libraries, but how often they are exploitable in deployed systems rests on few measurements.** A 2018 study found thousands of superlinear regular expressions affecting over 10,000 JavaScript and Python modules (Davis et al., 2018 [23]). Its authors did not check whether malicious input could reach them (Davis et al., 2018 [24]). A 2022 study that did test live websites found 6 vulnerable domains among 475 with published API specifications (Barlas et al., 2022). The first counts library modules and the second live web domains, so the two figures do not compare directly (Davis et al., 2018 [23]; Barlas et al., 2022 [25]).

## Inside grep and ripgrep

**Fast text-search tools use literal strings to filter before running the full regular expression.** GNU grep 3.11 combines a lazily built DFA with Boyer–Moore and Aho–Corasick searches for fixed strings (Free Software Foundation, 2023). Ripgrep finds candidate lines with a literal filter and runs the full regex engine only on those lines (Gallant, 2016).

The workload decides how much any tool's speed matters. In the ripgrep project's own benchmarks, many matches often narrowed the differences between tools (Gallant & ripgrep contributors, n.d. [26]). Searching large files for a pattern with no literal to filter on made performance drop sharply across all tools (Gallant & ripgrep contributors, n.d. [27]).

## Indexes for repeated searches

For a body of text searched many times, **the kind of query decides which index fits**. A positional inverted index records where each word occurs and answers phrase queries by intersecting those lists (Ferragina et al., 2008 [28]). For arbitrary substrings, a suffix array (every position in the text, sorted by the text that follows it) answers queries that cross word boundaries. Compressed self-indexes such as the FM-index can reproduce any part of the text, so they replace the original text (Ferragina et al., 2008 [29]).

Compressed indexes save space at the cost of speed, and the cost is largest when every match must be located. In the 2008 Pizza&Chili benchmark on English text, a plain suffix array counted matches in 0.512 microseconds per pattern symbol, at five times the size of the text. An FM-index variant took 2.694 microseconds at 0.42 times the text size, without the extra data needed to locate matches (Ferragina et al., 2008 [30]). To locate occurrences of five-symbol patterns, the plain suffix array was 100 to 1,000 times faster per occurrence than any compressed index tested (Ferragina et al., 2008 [31]).

Other designs win when patterns occur often. At comparable memory, inverted files that index fixed-length q-grams located patterns faster than compressed suffix arrays when there were many occurrences (Puglisi et al., 2006).

Recent large systems still report a penalty for locating. In Infini-gram mini, an FM-index over web-scale text, mapping every match back to its position in the original text was too slow for some uses (Xu et al., 2025f [32]). Its document retrieval also remained slower than a plain suffix array (Xu et al., 2025f [33]).

## Edit distance and fuzzy matching

Edit distance, or Levenshtein distance, counts the fewest single-character insertions, deletions and substitutions that turn one string into another (Ding et al., 2023 [34]). Three tasks use it: comparing two strings, finding dictionary entries within an edit limit, and recovering the sequence of edits. **The fastest method differs by task, by the edit limit and by the edit costs.**

For short strings with a low edit limit, bit-parallel algorithms can lead. Bit-parallel methods pack many cells of the distance table into the bits of one machine word. One blog benchmark matched a name against 1,000 candidates with a three-edit cutoff. A prepared Myers bit-parallel implementation averaged 5.415 microseconds, against 51.068 for the same author's bounded Ukkonen implementation (Hallman, 2026).

Libraries pick an algorithm by cutoff and edit costs. RapidFuzz uses the mbleven algorithm when the cutoff is three or less with equal edit costs (Bachmann, n.d. [35]). For other edit costs it uses Wagner–Fischer, the classic table-filling dynamic program (Bachmann, n.d. [36]).

Searching a large dictionary costs time in proportion to the candidates the search must consider. In dictionary experiments at a fixed edit limit, correction time depended on the expected number of candidates, which fell for longer query words (Mihov & Schulz, 2004).

For long strings that differ by few edits, one parallel method stands out. In a benchmark of parallel algorithms on real-world data, a block-hashing approach generally led when the edit distance was small (Ding et al., 2023 [37]). That benchmark computed only the distance, not the sequence of edits (Ding et al., 2023 [34]).

## Further reading

- Tarhio et al. (2017): a benchmark of exact single-pattern search showing SIMD scanning beating classic algorithms on short patterns, and where it stops winning.
- Kanda et al. (2023): how the memory layout of an Aho–Corasick automaton changes its speed on large dictionaries.
- Davis et al. (2018): the ecosystem-scale study of slow regular expressions in JavaScript and Python packages.
- Rust regex contributors (n.d.): documentation that states precisely what a linear-time regex guarantee covers, for one search and for iteration.
- Ferragina et al. (2008): the Pizza&Chili comparison of plain and compressed text indexes, for counting and locating matches.
- Gallant (2016): the ripgrep author's account of how literal filtering and engine choice make a search tool fast.

## Known gaps

- String hashing and fingerprinting (rolling hashes such as Rabin–Karp used for deduplication, and their collision risk) were not researched.
- No measurement isolates the input size or first-match position below which a simple scalar search beats a SIMD search.
- Whether the 2008 gap between plain suffix arrays and compressed indexes for locating many matches still holds was not measured with current implementations under matched conditions.
- How exposure to regular-expression denial of service has changed over time is not established: the two studies measured different populations.
- Current benchmarks of grep implementations on equal file sets, encodings and output were not researched.
- The cost of producing the sequence of edits, rather than only the distance, for long strings was not researched.
- Word-oriented compressed indexes compared with positional inverted indexes for document retrieval under memory limits were not researched.

## Claims cited

Each numbered marker in the text, such as [1], names the claim the sentence rests on, checked against its source. Verified: a verifier found the quoted passage on the source page. Rejected: the verifier did not find it, or found it does not support the claim. Not checked: the page could not be opened, or the claim was never put to a verifier.

- [1] In the authors’ comparison, SIMD-naïve counted matches fastest for patterns up to about 50 symbols. Source: Tarhio et al. (2017). Quote: "the fastest one for patterns of length up to about 50 symbols" Verified.
- [2] EPSM and SBNDM4 had an advantage over the authors’ frequency-ordered SIMD search for long patterns on small alphabets. Source: Tarhio et al. (2017). Quote: "previous algorithms EPSM and SBNDM4 have an advantage for small alphabets and long patterns" Verified.
- [3] On uniformly random inputs, Marino and Tarhio found that SSB and similar methods fared better in the region with longer patterns and larger alphabets. Source: Marino & Tarhio (2026). Quote: "For longer patterns and larger alphabets, the performance landscape shifts, favoring approaches such as SSB, which has been designed for long patterns." Verified.
- [4] The revised SMART benchmark’s largest English-text speedup for the CRC32C-64 EPSM variant over original EPSM was 5.3 times at pattern length 4,096. Source: Marino & Tarhio (2026). Quote: "Method  | X-Hash  | M-Hash  | CRC32C-64  | CRC32
--- | --- | --- | --- | ---
Algorithm  | WFR$$$ {}_{08\mathrm{X}} $$$  | EPSM$$$ {}_{08\mathrm{M}} $$$  | EPSM$$$ {}_{16\mathrm{C}8} $$$  | WFR$$$ {}_{08\mathrm{C}4} $$$
Ref. algorithm  | WFR$$$ {}_{08} $$$  | EPSM  | EPSM  | EPSM
$$$ m $$$  | 32768  | 4096  | 4096  | 1024
Speedup  | 3.1  | 4.4  | 5.3  | 2.9" Verified.
- [5] In the maintainer's comparison of memchr 2.5.0 to a Rust 1.73 nightly standard library, including construction narrowed memchr's advantage across the benchmark suite. Source: Gallant & memchr contributors (n.d.). Quote: "The difference is a little smaller when you include construction time in your measurements." Verified.
- [6] The memchr project notes that its prebuilt benchmark for the standard library approximates preprocessing reuse with a match iterator because the API cannot omit construction. Source: Gallant & memchr contributors (n.d.). Quote: "The prebuilt benchmark for the standard library can't actually avoid measuring searcher construction at some level, because there is no API for it." Verified.
- [7] Rust memchr uses Rabin–Karp for very small haystacks to reduce latency. Source: Gallant & memchr contributors (n.d.). Quote: "Rabin-Karp is used to reduce latency. Rabin-Karp has very small overhead and can often complete before other searchers have even been constructed." Verified.
- [8] Java String.indexOf documents that it returns the index of the first occurrence of the substring, or -1 when absent. Source: Oracle and/or its affiliates (n.d.a). Quote: "the index of the first occurrence of the specified substring,
     *          or {@code -1} if there is no such occurrence." Verified.
- [9] OpenJDK 25's String.indexOf routes equal-encoding pairs to a Latin-1 or UTF-16 search routine. Source: Oracle and/or its affiliates (n.d.a). Quote: "return isLatin1() ? StringLatin1.indexOf(value, str.value)
                              : StringUTF16.indexOf(value, str.value);" Verified.
- [10] The Rust aho-corasick crate can use Teddy to confirm matches directly, allowing it to skip the Aho–Corasick automaton. Source: Gallant (n.d.). Quote: "it confirms its own matches, so when Teddy is active, it might not be necessary for Aho-Corasick to run at all." Verified.
- [11] The crate switches from Teddy to Rabin–Karp for haystacks below Teddy’s minimum length. Source: Gallant (n.d.). Quote: "When the haystack is shorter than that, Rabin-Karp is used instead." Verified.
- [12] In the Vaporetto Japanese tokenizer benchmark, character-wise Daachorse took 2.9 microseconds per sentence versus 7.3 for DFA-AC and 7.5 for NFA-AC. Source: Kanda et al. (2023). Quote: "Charwise-Daachorse performed in 2.9 microseconds per sentence,

  * •

NFA-AC performed in 7.5 microseconds per sentence, and

  * •

DFA-AC performed in 7.3 microseconds per sentence." Verified.
- [13] Character-wise and mapped Daachorse variants matched faster than the byte-wise variant on the two Japanese datasets, with fewer random accesses. Source: Kanda et al. (2023). Quote: "On JaWord and JaChars, Charwise and Mapped are faster than Bytewise because of their fewer random accesses." Verified.
- [14] A Thompson NFA search maintains a set of states and advances each across its possible transitions for an input symbol. Source: Rust regex-automata contributors (n.d.). Quote: "Namely, in order to execute a search for any Thompson NFA, one needs to keep track of a set of states, and execute the possible transitions on all of those states for each input symbol." Verified.
- [15] A DFA can take exponential time or space to build. Source: Rust regex-automata contributors (n.d.). Quote: "A DFA, on the other hand, may take exponential time and/or space to build." Verified.
- [16] The Rust regex-automata hybrid NFA/DFA avoids the exponential build time of a DFA. Source: Rust regex-automata contributors (n.d.). Quote: "It avoids the exponential build time of a DFA while maintaining its fast search time." Verified.
- [17] In the 2019 Symbolic Regex Matcher evaluation, compiling a pattern into a matcher took longer in SRM than in RE2 or .NET. Source: Saarikivi et al. (2019). Quote: "Compilation of regular expressions into matcher objects takes more time in SRM than RE2 or .NET." Verified.
- [18] On the Assorted benchmark, SRM had a lower mean matching time than RE2, which the authors attribute to RE2's more severe outliers. Source: Saarikivi et al. (2019). Quote: "While SRM achieves a lower average matching time on Assorted, this is due to the more severe outliers in RE2’s performance profile" Verified.
- [19] .NET's NonBacktracking mode is designed for search time proportional to text length. Source: Microsoft (2023). Quote: "This mode is designed to execute in time proportional to the length of the input." Verified.
- [20] A single Rust regex search has worst-case O(m × n) time, with m proportional to pattern size and n proportional to text size. Source: Rust regex contributors (n.d.). Quote: "In exchange, all regex searches in this crate have worst case O(m * n) time complexity, where m is proportional to the size of the regex and n is proportional to the size of the string being searched." Verified.
- [21] Rust regex documents worst-case O(m × n²) for its match iterators because they can repeatedly scan the haystack. Source: Rust regex contributors (n.d.). Quote: "the worst case time complexity for iterators is O(m * n^2)." Verified.
- [22] Microsoft recommends a timeout when a backtracking regex relies on backtracking or receives untrusted input. Source: Microsoft (2023). Quote: "we recommend that you always set a time-out interval if your regular expression relies on backtracking or operates on untrusted inputs." Verified.
- [23] A 2018 ecosystem study reported thousands of superlinear regular expressions affecting over 10,000 modules across JavaScript and Python. Source: Davis et al. (2018). Quote: "we detected thousands of super-linear regexes affecting over 10,000 modules across diverse application domains." Verified.
- [24] The 2018 ecosystem study did not confirm whether the superlinear regexes it found were exploitable in deployment. Source: Davis et al. (2018). Quote: "we did not perform taint analysis to confirm that malign input could reach these regexes" Verified.
- [25] Barlas and colleagues reported six vulnerable domains in a sample of 475 with OpenAPI specifications. Source: Barlas et al. (2022). Quote: "there were 475 web domains; 83 of them document their input sanitization regexes; and 6 of these (15 distinct subdomains) are vulnerable to ReDoS." Verified.
- [26] The ripgrep project reports that high match counts often narrow tool differences because match handling dominates. Source: Gallant & ripgrep contributors (n.d.). Quote: "high match counts also tend to both tank performance and smooth out the differences between tools" Verified.
- [27] The ripgrep README reports sharp slowdowns across tools when regexes on large files offer no literal optimization. Source: Gallant & ripgrep contributors (n.d.). Quote: "performance can drop precipitously across the board when searching big files for patterns without any opportunities for literal optimizations" Verified.
- [28] A positional word inverted index stores each word's occurrence positions and can answer phrase queries by intersecting lists. Source: Ferragina et al. (2008). Quote: "An inverted list is essentially a table recording the positions of the occurrences of every distinct word in the indexed text. Thus every word-based query is already pre-computed, and phrase queries are carried out via list intersections." Verified.
- [29] A compressed full-text self-index can recover substrings directly, replacing the original text. Source: Ferragina et al. (2008). Quote: "those indexes are able to reproduce any text portion without accessing the original text, and thus they *replace* the text" Verified.
- [30] In the 2008 Pizza&Chili counting benchmark, the plain suffix array on English text took 0.512 microseconds per pattern symbol at a total size of 5 times the text, while the alphabet-friendly FM-index took 2.694 at 0.42 times the text without locate and extract support. Source: Ferragina et al. (2008). Quote: "english | **2.147** | 0.60 | 2.694 | **0.42** | 4.758 | **0.44** | 68.774 | 1.27 | 0.512 | 5" Verified.
- [31] In the same study locating tests for five-symbol patterns, the authors reported that the plain suffix array took between 100 and 1,000 times less time per occurrence than any tested compressed index, using five times the size of the text. Source: Ferragina et al. (2008). Quote: "it is between 100 and 1,000 times faster than any compressed index, but always 5 times larger than the indexed text." Verified.
- [32] The authors report that recovering positions for every match in a suffix-array range makes co-occurrence impractical in their FM-index system. Source: Xu et al. (2025f). Quote: "mapping every match from the suffix array range back to its position in original text takes very long time" Verified.
- [33] Infini-gram Mini authors report document retrieval latency remains higher than a canonical suffix array. Source: Xu et al. (2025f). Quote: "document retrieval latency remains higher than a canonical suffix array." Verified.
- [34] The benchmarked parallel algorithms compute Levenshtein distance with unit-cost insertions, deletions, and substitutions. Source: Ding et al. (2023). Quote: "In this paper, we use edit distance to refer to the Levenshtein distance, which allows for unit-cost single-character edits (insertions, deletions, substitutions)." Verified.
- [35] RapidFuzz documents a uniform-cost edit-distance path that uses mbleven when the cutoff is at most three, after the zero-cutoff special case. Source: Bachmann (n.d.). Quote: "If score_cutoff is ≤ 3 the mbleven algorithm is used." Verified.
- [36] RapidFuzz documents a Wagner–Fischer dynamic program for generic edit costs. Source: Bachmann (n.d.). Quote: "The implementation for other weights is based on Wagner-Fischer." Verified.
- [37] On the authors’ real-world data, their blocked hashing approach generally had the advantage when edit distance k was small, as in the synthetic tests. Source: Ding et al. (2023). Quote: "The results are mostly consistent with our synthetic datasets, where BFS-B-HASH is more advantageous when k is small" Verified.

## References

Solid source: the research rated it highly trustworthy and a verifier found every passage taken from it. Weak source: rated low, or a verifier did not find a passage taken from it. Medium trust: rated medium; neither weak nor solid. Not checked: rated high, but its passages could not all be checked against it.

- Aydoğmuş, M. A., & Külekci, M. O. (2019). Optimizing packed string matching on AVX2 platform. *High Performance Computing for Computational Science, VECPAR 2018*. https://www.academia.edu/41955916/Optimizing_Packed_String_Matching_on_AVX2_Platform [Medium trust. Peer-reviewed, read in large part.]
- Bachmann, M. (n.d.). Levenshtein. *RapidFuzz documentation*. https://rapidfuzz.github.io/RapidFuzz/Usage/distance/Levenshtein.html [Solid source. Documentation, read in large part.]
- Barlas, E., Du, X., & Davis, J. C. (2022). Exploiting input sanitization for regex denial of service. *44th International Conference on Software Engineering*. https://davisjam.github.io/files/publications/BarlasDuDavis-WebREDOS-ICSE2022.pdf [Solid source. Peer-reviewed, read in large part.]
- Davis, J. C., Coghlan, C. A., Servant, F., & Lee, D. (2018). The impact of regular expression denial of service (ReDoS) in practice: An empirical study at the ecosystem scale. *Proceedings of the 26th ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering (ESEC/FSE 18)*. https://davisjam.github.io/files/publications/DavisCoghlanServantLee-EcosystemREDOS-ESECFSE18.pdf [Solid source. Peer-reviewed, read in large part.]
- Ding, X., Dong, X., Gu, Y., Liu, Y., & Sun, Y. (2023). Efficient parallel output-sensitive edit distance. *31st Annual European Symposium on Algorithms (ESA 2023)*. https://drops.dagstuhl.de/storage/00lipics/lipics-vol274-esa2023/LIPIcs.ESA.2023.40/LIPIcs.ESA.2023.40.pdf [Solid source. Peer-reviewed, read in large part.]
- Ferragina, P., González, R., Navarro, G., & Venturini, R. (2008). Compressed text indexes: From theory to practice. *ACM Journal of Experimental Algorithmics*. https://pages.di.unipi.it/rossano/assets/pdf/papers/JEA08.pdf [Solid source. Peer-reviewed, read in large part.]
- Gallant, A. (n.d.). DESIGN.md (aho-corasick 1.1.5). *Docs.rs*. https://docs.rs/crate/aho-corasick/latest/source/DESIGN.md [Solid source. Documentation, read in large part.]
- Gallant, A. (2016). ripgrep is faster than grep, ag, git grep, ucg, pt, sift. *Andrew Gallant's Blog*. https://burntsushi.net/ripgrep/ [Medium trust. Blog post, read in large part.]
- Gallant, A., & memchr contributors (n.d.). memchr. *GitHub*. https://github.com/BurntSushi/memchr [Medium trust. Documentation, read in large part.]
- Gallant, A., & ripgrep contributors (n.d.). ripgrep. *GitHub*. https://github.com/BurntSushi/ripgrep [Medium trust. Documentation, read in large part.]
- Hallman, C. (2026). Optimizing Levenshstein for fuzzy name matching. *Connor Hallman (blog)*. https://connorhallman.com/blog/optimizing-levenshtein [Solid source. Blog post, read in large part.]
- Kanda, S., Akabe, K., & Oda, Y. (2023). Engineering faster double-array Aho–Corasick automata. *Software: Practice and Experience*. https://arxiv.org/html/2207.13870 [Solid source. Peer-reviewed, read in large part.]
- Marino, F. P., & Tarhio, J. (2026). Improving string matching through enhanced hashing. *Software: Practice and Experience*. https://onlinelibrary.wiley.com/doi/10.1002/spe.70087?af=R [Solid source. Peer-reviewed, read in large part.]
- Mihov, S., & Schulz, K. U. (2004). Fast approximate search in large dictionaries. *Computational Linguistics*. https://www.cis.uni-muenchen.de/download/publikationen/fastapproxsearch.pdf [Solid source. Peer-reviewed, read in large part.]
- Puglisi, S. J., Smyth, W. F., & Turpin, A. (2006). Inverted files versus suffix arrays for locating patterns in primary memory. *String Processing and Information Retrieval*. https://researchportal.murdoch.edu.au/esploro/outputs/journalArticle/Inverted-files-versus-suffix-arrays-for/991005541091207891 [Medium trust. Peer-reviewed, abstract only.]
- Saarikivi, O., Veanes, M., Wan, T., & Xu, E. (2019). Symbolic regex matcher. *Tools and Algorithms for the Construction and Analysis of Systems*. https://www.microsoft.com/en-us/research/wp-content/uploads/2019/02/SRM_tacas19.pdf [Solid source. Peer-reviewed, read in large part.]
- Salmela, L., Tarhio, J., & Kytöjoki, J. (2006). Multi-pattern string matching with q-grams. *ACM Journal of Experimental Algorithmics*. https://users.aalto.fi/~tarhio/papers/jea.pdf [Medium trust. Peer-reviewed, read in large part.]
- Susik, R., Grabowski, S., & Fredriksson, K. (2014). Multiple pattern matching revisited. *arXiv*. https://arxiv.org/pdf/1405.5483 [Solid source. Peer-reviewed, read in large part.]
- Tarhio, J., Holub, J., & Giaquinta, E. (2017). Technology beats algorithms (in exact string matching). *Software: Practice and Experience*. https://onlinelibrary.wiley.com/doi/full/10.1002/spe.2511 [Solid source. Peer-reviewed, read in large part.]
- Toub, S. (2022). Regular expression improvements in .NET 7. *.NET Blog*. https://devblogs.microsoft.com/dotnet/regular-expression-improvements-in-dotnet-7/ [Medium trust. Vendor page, read in large part.]
- Varatalu, I. E., Veanes, M., & Ernits, J. (2025). RE#: High performance derivative-based regex matching with intersection, complement, and restricted lookarounds. *Proceedings of the ACM on Programming Languages*. https://www.microsoft.com/en-us/research/wp-content/uploads/2025/01/popl25-p2-final.pdf [Medium trust. Peer-reviewed, read in large part.]
- Xu, H., Liu, J., Choi, Y., Smith, N. A., & Hajishirzi, H. (2025f). Infini-gram mini: Exact n-gram search at the internet scale with FM-index. *Proceedings of the 2025 Conference on Empirical Methods in Natural Language Processing*. https://aclanthology.org/2025.emnlp-main.1268.pdf [Solid source. Peer-reviewed, read in large part.]
- Free Software Foundation (2023). GNU grep 3.11 README. *GNU grep 3.11 source distribution*. https://sources.debian.org/src/grep/3.11-4/README [Solid source. Documentation, read in large part.]
- Microsoft (2023). Backtracking in regular expressions. *Microsoft Learn*. https://learn.microsoft.com/en-us/dotnet/standard/base-types/backtracking-in-regular-expressions [Solid source. Documentation, read in large part.]
- Oracle and/or its affiliates (n.d.a). String.java. *OpenJDK 25 build 36*. https://raw.githubusercontent.com/openjdk/jdk/jdk-25%2B36/src/java.base/share/classes/java/lang/String.java [Solid source. Documentation, read in full.]
- Oracle and/or its affiliates (n.d.b). StringLatin1.java. *OpenJDK 25 build 36*. https://raw.githubusercontent.com/openjdk/jdk/jdk-25%2B36/src/java.base/share/classes/java/lang/StringLatin1.java [Solid source. Read in full.]
- Python Software Foundation (n.d.a). Built-in types. *Python 3.14 documentation*. https://docs.python.org/3.14/builtins/stdtypes.html#str.find [Solid source. Documentation, read in large part.]
- Python Software Foundation (n.d.o). fastsearch.h. *CPython v3.14.0*. https://raw.githubusercontent.com/python/cpython/v3.14.0/Objects/stringlib/fastsearch.h [Solid source. Documentation, read in full.]
- RE2 contributors (n.d.). RE2. *GitHub*. https://github.com/google/re2 [Solid source. Documentation, read in large part.]
- Rust regex contributors (n.d.). regex - Rust. *Docs.rs*. https://docs.rs/regex/latest/regex/ [Solid source. Documentation, read in large part.]
- Rust regex-automata contributors (n.d.). NFA in regex_automata::nfa::thompson - Rust. *Docs.rs*. https://docs.rs/regex-automata/latest/regex_automata/nfa/thompson/struct.NFA.html [Weak source. Documentation, read in large part.]
- The Go Authors (n.d.d). strings.go, public strings package. *Go 1.25.0*. https://raw.githubusercontent.com/golang/go/go1.25.0/src/strings/strings.go [Solid source. Documentation, read in full.]
- The Go Authors (n.d.c). strings.go, internal substring search. *Go 1.25.0*. https://raw.githubusercontent.com/golang/go/go1.25.0/src/internal/stringslite/strings.go [Solid source. Read in full.]
- The Go Authors (2026b). regexp package - regexp. *Go Packages*. https://pkg.go.dev/regexp [Solid source. Documentation, read in large part.]
