pub struct Regex { /* private fields */ }
Expand description
GLib type: Shared boxed type with reference counted clone semantics.
Implementations§
source§impl Regex
impl Regex
sourcepub fn for_match(pattern: &str, flags: u32) -> Result<Regex, Error>
pub fn for_match(pattern: &str, flags: u32) -> Result<Regex, Error>
Compiles @pattern into a regex for use as a match regex with vte_terminal_match_add_regex() or vte_terminal_event_check_regex_simple().
See man:pcre2pattern(3) for information about the supported regex language, and man:pcre2api(3) for information about the supported @flags.
The regex will be compiled using
§pattern
a regex pattern string
§pattern_length
the length of @pattern in bytes, or -1 if the string is NUL-terminated and the length is unknown
§flags
PCRE2 compile flags
§Returns
a newly created #VteRegex, or None
with @error filled in
sourcepub fn for_match_full(
pattern: &str,
flags: u32,
extra_flags: u32,
) -> Result<(Regex, usize), Error>
Available on crate feature v0_76
only.
pub fn for_match_full( pattern: &str, flags: u32, extra_flags: u32, ) -> Result<(Regex, usize), Error>
v0_76
only.Compiles @pattern into a regex for use as a match regex with vte_terminal_match_add_regex() or vte_terminal_event_check_regex_simple().
See man:pcre2pattern(3) for information about the supported regex language, and man:pcre2api(3) for information about the supported @flags and @extra_flags.
The regex will be compiled using
If regex compilation fails, @error will be set and @error_offset point to error as an offset into @pattern.
§pattern
a regex pattern string
§pattern_length
the length of @pattern in bytes, or -1 if the string is NUL-terminated and the length is unknown
§flags
PCRE2 compile flags
§extra_flags
PCRE2 extra compile flags
§Returns
a newly created #VteRegex, or None
§error_offset
return location to store the error offset
sourcepub fn for_search(pattern: &str, flags: u32) -> Result<Regex, Error>
pub fn for_search(pattern: &str, flags: u32) -> Result<Regex, Error>
Compiles @pattern into a regex for use as a search regex with vte_terminal_search_set_regex().
See man:pcre2pattern(3) for information about the supported regex language, and man:pcre2api(3) for information about the supported @flags.
The regex will be compiled using
§pattern
a regex pattern string
§pattern_length
the length of @pattern in bytes, or -1 if the string is NUL-terminated and the length is unknown
§flags
PCRE2 compile flags
§Returns
a newly created #VteRegex, or None
with @error filled in
sourcepub fn for_search_full(
pattern: &str,
flags: u32,
extra_flags: u32,
) -> Result<(Regex, usize), Error>
Available on crate feature v0_76
only.
pub fn for_search_full( pattern: &str, flags: u32, extra_flags: u32, ) -> Result<(Regex, usize), Error>
v0_76
only.Compiles @pattern into a regex for use as a search regex with vte_terminal_search_set_regex().
See man:pcre2pattern(3) for information about the supported regex language, and man:pcre2api(3) for information about the supported @flags and @extra_flags.
The regex will be compiled using
If regex compilation fails, @error will be set and @error_offset point to error as an offset into @pattern.
§pattern
a regex pattern string
§pattern_length
the length of @pattern in bytes, or -1 if the string is NUL-terminated and the length is unknown
§flags
PCRE2 compile flags
§Returns
a newly created #VteRegex, or None
§error_offset
return location to store the error offset
Trait Implementations§
source§impl HasParamSpec for Regex
impl HasParamSpec for Regex
source§impl Ord for Regex
impl Ord for Regex
source§impl PartialEq for Regex
impl PartialEq for Regex
source§impl PartialOrd for Regex
impl PartialOrd for Regex
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl StaticType for Regex
impl StaticType for Regex
source§fn static_type() -> Type
fn static_type() -> Type
Self
.impl Eq for Regex
impl StructuralPartialEq for Regex
Auto Trait Implementations§
impl Freeze for Regex
impl RefUnwindSafe for Regex
impl !Send for Regex
impl !Sync for Regex
impl Unpin 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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)