pub fn is_match(&self, text: &str) -> Result<bool> {
        match &self.inner {
            RegexImpl::Wrap { ref inner, .. } => Ok(inner.is_match(text)),
            RegexImpl::Fancy {
                ref prog, options, ..
            } => {
                let result = vm::run(prog, text, 0, 0, options)?;
                Ok(result.is_some())
            }
        }
    }
/// Check if the regex matches the input text.
///
/// # Example
///
/// Test if some text contains the same word twice:
///
/// ```rust
/// # use fancy_regex::Regex;
///
/// let re = Regex::new(r"(\w+) \1").unwrap();
/// assert!(re.is_match("mirror mirror on the wall").unwrap());
/// ```
Check if the regex matches the input text.
Check if the regex matches the input text .
pub fn is_match(&self, text: &str) -> Result<bool> {
        match &self.inner {
            RegexImpl::Wrap { ref inner, .. } => Ok(inner.is_match(text)),
            RegexImpl::Fancy {
                ref prog, options, ..
            } => {
                let result = vm::run(prog, text, 0, 0, options)?;
                Ok(result.is_some())
            }
        }
    }
pub fn is_match ( & self , text : & str ) -> Result < bool > { match & self . inner { RegexImpl :: Wrap { ref inner , .. } => Ok ( inner . is_match ( text ) ) , RegexImpl :: Fancy { ref prog , options , .. } => { let result = vm :: run ( prog , text , 0 , 0 , options ) ? ; Ok ( result . is_some ( ) ) } } }
Check if the regex matches the input text.
Check if the regex matches the input text .
&self
text
&str
&self
text
&str
example
Test if some text contains the same word twice.


Test if some text contains the same word twice .
use fancy_regex::regex;
let re = Regex::new(r"(\w+) \1").unwrap();
assert!(re.is_match("mirror mirror on the wall").unwrap());
```
let re = Regex :: new ( r " ( \ w + ) \ 1 " ) . unwrap () ; assert! ( re . is_match ( " mirror mirror on the wall " ) . unwrap () ) ; ` ` `