• Home
  • Raw
  • Download

Lines Matching +full:no +full:- +full:dynamic +full:- +full:engine

7 you can do no better than Russ Cox's article series on implementing regular
19 --- This library contains such an implementation in src/pikevm.rs.
29 prefixes is in the regex-syntax crate (in this repository). The code to search
31 we fall back to an Aho-Corasick DFA using the aho-corasick crate. For one
32 literal, we use a variant of the Boyer-Moore algorithm. Both Aho-Corasick and
33 Boyer-Moore use `memchr` when appropriate. The Boyer-Moore variant in this
45 memory requirement, we only use this engine on small search strings *and* small
63 The following sub-sections describe the rest of the library and how each of the
68 Regular expressions are parsed using the regex-syntax crate, which is
69 maintained in this repository. The regex-syntax crate defines an abstract
75 The regex-syntax crate also provides sophisticated support for extracting
84 non-deterministic finite automaton. In particular, the opcodes explicitly rely
124 on raw bytes. In the former case, the matching engine is responsible for
125 performing UTF-8 decoding and executing instructions using Unicode codepoints.
126 In the latter case, the program handles UTF-8 decoding implicitly, so that the
127 matching engine can execute on raw bytes. All matching engines can execute
135 N.B. UTF-8 decoding is built into the compiled program by making use of the
136 utf8-ranges crate. The compiler in this library factors out common suffixes to
149 program, since it is never needed if (1) the regular expression uses no word
150 boundary assertions and (2) the caller never asks for sub-capture locations.
158 3. Literal substring or multi-substring search.
159 4. Lazy DFA (no support for Unicode word boundary assertions).
165 engine (or engines) to use.
167 The logic for choosing which engine to execute is in src/exec.rs and is
172 For the most part, the execution logic is straight-forward and follows the
173 limitations of each engine described above pretty faithfully. The hairiest
179 engine. This scratch space is used during search (for example, for the lazy
190 The `regex!` macro no longer exists. It was developed in a bygone era as a
192 matching engine in the crate was the Pike VM. The `regex!` macro was, itself,
193 also a Pike VM. The only advantages it offered over the dynamic Pike VM that
203 version of a slow regex engine. As the regex crate evolved, it grew other regex
206 than the dynamic engines. The only reason left to use it was for the compile
216 dynamic engines in some cases. But it will be challenging! As of now, there
217 are no plans to work on this.
225 located in src/testdata. The scripts/regex-match-tests.py takes the test suite
234 the AT&T test suite) and code generate tests for each matching engine. The
236 matching engine we want to test. The entry points are:
238 * `tests/test_default.rs` - tests `Regex::new`
239 * `tests/test_default_bytes.rs` - tests `bytes::Regex::new`
240 * `tests/test_nfa.rs` - tests `Regex::new`, forced to use the NFA
242 * `tests/test_nfa_bytes.rs` - tests `Regex::new`, forced to use the NFA
244 * `tests/test_nfa_utf8bytes.rs` - tests `Regex::new`, forced to use the NFA
245 algorithm on every regex and use *UTF-8* byte based programs.
246 * `tests/test_backtrack.rs` - tests `Regex::new`, forced to use
248 * `tests/test_backtrack_bytes.rs` - tests `Regex::new`, forced to use
250 * `tests/test_backtrack_utf8bytes.rs` - tests `Regex::new`, forced to use
251 backtracking on every regex and use *UTF-8* byte based programs.
252 * `tests/test_crates_regex.rs` - tests to make sure that all of the
264 times slightly, try using `cargo test --test default`, which will only use the
276 The benchmarking in this crate is made up of many micro-benchmarks. Currently,
292 * `bench_rust.rs` - benchmarks `Regex::new`
294 * `bench_pcre.rs` - benchmarks PCRE
295 * `bench_onig.rs` - benchmarks Oniguruma
313 $ cargo benchcmp old new --improvements
315 The `cargo-benchcmp` utility is available here:
316 https://github.com/BurntSushi/cargo-benchcmp
319 `./bench/bench --help`.
335 $ rustdoc --crate-name docs src/lib.rs -o target/doc -L target/debug/deps --no-defaults --passes co…
340 See https://github.com/rust-lang/rust/issues/15347 for more info