hitori_examples/
any_patterns.rs

1//! An any-pattern matches if one of its subpatterns matches.
2//! In [hitori] syntax it is represented as an array of its subpatterns.
3//!
4//! ```
5#![doc = include_str!("any_patterns/float_type.rs")]
6//!
7//! assert!(hitori::string::starts_with(FloatType, "f64").is_some());
8//! assert!(hitori::string::starts_with(FloatType, "f128").is_none());
9//! ```
10//! *equivalent to `f(32|64)` in [regex] syntax*
11//!
12//! ### Empty any-pattern
13//!
14//! An empty any-pattern is always false.
15//!
16//! ```
17#![doc = include_str!("any_patterns/false_.rs")]
18//!
19//! for s in ["Hello, world!", "34", "hitori"] {
20//!     assert!(hitori::string::starts_with(False, s).is_none());
21//! }
22//! ```
23//!
24//! [hitori]: https://docs.rs/hitori
25//! [regex]: https://docs.rs/regex
26
27mod false_;
28mod float_type;
29
30pub use false_::{False, FalseCapture};
31pub use float_type::{FloatType, FloatTypeCapture};