pub struct SearchOptions {
pub regex: bool,
pub whole_word: bool,
pub case_sensitive: Option<bool>,
}Expand description
Search modes beyond the default literal + smart-case (see Term::search_with).
Mirrors xterm.js’s ISearchOptions (#314). The default (all off / smart-case) is exactly
Term::search.
Fields§
§regex: boolTreat the query as a regular expression (the regex crate) instead of a literal substring.
Caveats vs a JS RegExp (xterm.js): the regex crate has no lookaround/backreferences
and its \w \d \b are Unicode-aware by default. An invalid or unsupported pattern
yields no matches (an empty result) rather than an error — the current API has no error
channel, so a consumer cannot distinguish a bad pattern from a genuine no-match (#314).
Smart-case (see case_sensitive) infers case from the raw pattern,
so an uppercase metacharacter (\B, \D, \x1B…) can flip case-sensitivity — set
case_sensitive explicitly, or use an inline (?i)/(?-i), to be sure.
whole_word: boolMatch only where the run is bounded by non-word characters (a word char is alphanumeric or
_) — the \bword\b sense, applied to both literal and regex queries.
case_sensitive: Option<bool>None = smart-case (case-insensitive iff the query has no uppercase); Some(true) =
case-sensitive; Some(false) = force case-insensitive.
Trait Implementations§
Source§impl Clone for SearchOptions
impl Clone for SearchOptions
Source§fn clone(&self) -> SearchOptions
fn clone(&self) -> SearchOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more