pub struct Regex { /* private fields */ }Implementations§
Source§impl Regex
impl Regex
pub fn new(pattern: &str) -> Result<Self, RegexError>
pub fn is_match(&self, input: &str) -> bool
pub fn captures<'h>(&self, input: &'h str) -> Option<Captures<'h>>
pub fn captures_iter<'r, 'h>(&'r self, input: &'h str) -> CapturesIter<'r, 'h> ⓘ
Sourcepub fn replace<'h, R: Replacer>(&self, input: &'h str, rep: R) -> Cow<'h, str>
pub fn replace<'h, R: Replacer>(&self, input: &'h str, rep: R) -> Cow<'h, str>
Replace the FIRST match only. Mirrors regex crate replace.
pub fn replace_all<'h, R: Replacer>( &self, input: &'h str, rep: R, ) -> Cow<'h, str>
Auto Trait Implementations§
impl Freeze for Regex
impl RefUnwindSafe for Regex
impl Send for Regex
impl Sync for Regex
impl Unpin for Regex
impl UnsafeUnpin for Regex
impl UnwindSafe for Regex
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