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 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"));
impl Add 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 for HumanRegex
Allows the use of &
as a syntax sugar for and
impl BitAnd 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.
Auto Trait Implementations§
impl Freeze for HumanRegex
impl RefUnwindSafe for HumanRegex
impl Send for HumanRegex
impl Sync for HumanRegex
impl Unpin for HumanRegex
impl UnwindSafe for HumanRegex
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more