10 releases

0.2.3 Apr 26, 2023
0.2.2 Apr 19, 2023
0.1.5 Mar 25, 2023

#1019 in Text processing

Download history 27/week @ 2024-04-14 29/week @ 2024-04-21 1/week @ 2024-04-28 5/week @ 2024-05-05 18/week @ 2024-05-12 7/week @ 2024-05-19 5/week @ 2024-05-26 18/week @ 2024-06-02 21/week @ 2024-06-09 20/week @ 2024-06-16 30/week @ 2024-06-23 39/week @ 2024-06-30 22/week @ 2024-07-07 36/week @ 2024-07-14 11/week @ 2024-07-21 31/week @ 2024-07-28

100 downloads per month
Used in hitori-examples

MIT/Apache

2.5MB
360 lines

hitori crate hitori documentation Build status

Hitori is generic compile-time regular expressions library. It works by creating series of if-statements and for-loops for each expression.

See code samples along with the traits, impls and structs they expand to in examples.

Limitations

Pattern matching is step-by-step. It is impossible to to detach last element of a repetition. For example, using regex one can rewrite a+ as a*a and it would still match any sequence of as longer than zero. With hitori, however, a* would consume all the as, and the expression won't match.

Step-by step pattern matching also leads to diminished performance when matching large texts and an expression contains repetitions of frequent characters.

Crate features

  • alloc (enabled by default) – string replace functions and blanket implementations of hitori traits for boxes using alloc crate.
  • macros (enabled by default)impl_expr_mut and impl_expr macros.
  • find-hitori – finds hitori package to be used in macros even if it has been renamed in Cargo.toml. macros feature is required.
  • examples – includes examples module into the build.

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies