pub trait PatternMatch {
    // Required methods
    fn pattern_match_result(
        &self,
        pattern: &str,
        case_insensitive: bool
    ) -> Result<bool, Error>;
    fn pattern_match(&self, pattern: &str, case_insensitive: bool) -> bool;
    fn pattern_match_ci(&self, pattern: &str) -> bool;
    fn pattern_match_cs(&self, pattern: &str) -> bool;
}

Required Methods§

source

fn pattern_match_result( &self, pattern: &str, case_insensitive: bool ) -> Result<bool, Error>

Apply a regular expression match on the current String-like object If the regex doesn’t compile it will return an error

source

fn pattern_match(&self, pattern: &str, case_insensitive: bool) -> bool

source

fn pattern_match_ci(&self, pattern: &str) -> bool

source

fn pattern_match_cs(&self, pattern: &str) -> bool

Implementations on Foreign Types§

source§

impl PatternMatch for String

Implement regular expression match and replace methods for String

source§

fn pattern_match_result( &self, pattern: &str, case_insensitive: bool ) -> Result<bool, Error>

Simple regex-compatible match method that will return an optional boolean

  • Some(true) means the regex is valid and the string matches
  • Some(false) means the regex is valid and the string does not match
  • None means the regex is not valid and can this not be evaluated
source§

fn pattern_match(&self, pattern: &str, case_insensitive: bool) -> bool

Simple regex-compatible match method that will return false if the pattern does not match the source string or the regex fails

source§

fn pattern_match_ci(&self, pattern: &str) -> bool

Simple case-insensitive regex-compatible match method that will return false if the pattern does not match the source string or the regex fails

source§

fn pattern_match_cs(&self, pattern: &str) -> bool

Simple case-sensitive regex-compatible match method that will return false if the pattern does not match the source string or the regex fails

source§

impl PatternMatch for [String]

source§

fn pattern_match(&self, pattern: &str, case_insensitive: bool) -> bool

Simple regex-compatible match method that will return false if the pattern does not match the source string or the regex fails

source§

fn pattern_match_ci(&self, pattern: &str) -> bool

Case-insensitive regex-compatible match method that will return false if the pattern does not match the source string or the regex fails

source§

fn pattern_match_cs(&self, pattern: &str) -> bool

Case-sensitive regex-compatible match method that will return false if the pattern does not match the source string or the regex fails

source§

fn pattern_match_result( &self, pattern: &str, case_insensitive: bool ) -> Result<bool, Error>

Implementors§