Struct syntect::parsing::Regex [−][src]
pub struct Regex { /* fields omitted */ }
Expand description
An abstraction for regex patterns.
- Allows swapping out the regex implementation because it’s only in this module.
- Makes regexes serializable and deserializable using just the pattern string.
- Lazily compiles regexes on first use to improve initialization time.
Implementations
Create a new regex from the pattern string.
Note that the regex compilation happens on first use, which is why this method does not return a result.
Check whether the pattern compiles as a valid regex or not.
Search for the pattern in the given text from begin/end positions.
If a region is passed, it is used for storing match group positions. The argument allows
the Region
to be reused between searches, which makes a significant performance
difference.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Regex
impl UnwindSafe for Regex
Blanket Implementations
Mutably borrows from an owned value. Read more
Compare self to key
and return true
if they are equal.