| 1 |
#![allow(unused)] |
| 2 |
|
| 3 |
use glib::prelude::*; |
| 4 |
|
| 5 |
fn main() { |
| 6 |
let r = glib::Regex::new( |
| 7 |
"hello", |
| 8 |
glib::RegexCompileFlags::DEFAULT, |
| 9 |
glib::RegexMatchFlags::DEFAULT, |
| 10 |
) |
| 11 |
.unwrap() |
| 12 |
.unwrap(); |
| 13 |
let s = glib::GStr::from_str_until_nul("hello\0").unwrap(); |
| 14 |
let match_info = r |
| 15 |
.match_(s, glib::RegexMatchFlags::DEFAULT) |
| 16 |
.expect("should match"); |
| 17 |
assert_eq!(match_info.fetch_all(), vec!["hello"]); |
| 18 |
let v: glib::Value = match_info.to_value(); |
| 19 |
drop(match_info); |
| 20 |
let match_info = v.get::<glib::MatchInfo<'_>>().unwrap(); |
| 21 |
} |