Struct human_regex::HumanRegex
source · pub struct HumanRegex(pub String);
Expand description
The HumanRegex struct which maintains and updates the regex string. For most use cases it will never be necessary to instantiate this directly.
Tuple Fields§
§0: String
Implementations§
source§impl HumanRegex
impl HumanRegex
Trait Implementations§
source§impl Add<HumanRegex> for HumanRegex
impl Add<HumanRegex> for HumanRegex
let regex_string = human_regex::zero_or_one("chris") + human_regex::text("mccomb");
assert!(regex_string.to_regex().is_match("mccomb"));
assert!(regex_string.to_regex().is_match("chrismccomb"));
source§impl BitAnd<HumanRegex> for HumanRegex
impl BitAnd<HumanRegex> for HumanRegex
Allows the use of &
as a syntax sugar for and
use human_regex::{text, or, within};
let regex_string = (within('a'..='y') & or(&['x','y','z']));
println!("{}", regex_string);
assert!(regex_string.to_regex().is_match("x"));
assert!(regex_string.to_regex().is_match("y"));
assert!(!regex_string.to_regex().is_match("z"));
source§impl Debug for HumanRegex
impl Debug for HumanRegex
source§impl Display for HumanRegex
impl Display for HumanRegex
source§impl From<HumanRegex> for String
impl From<HumanRegex> for String
source§fn from(hr: HumanRegex) -> Self
fn from(hr: HumanRegex) -> Self
Converts to this type from the input type.