// include the latest version of the regex crate in your Cargo.toml
extern crate regex;
use regex::Regex;
fn main() {
let regex = Regex::new(r"SELECT \* FROM (`)?\w+\1 WHERE .*").unwrap();
let string = "SELECT * FROM `commands` WHERE `UID` LIKE '70f8b955-fe64-4efe-8976-737c77c12c4b' AND `InsertTime` > '1464091507' OR `UID` LIKE \"\" AND `InsertTime` > '1464091507'$checkin:5000;#";
// result will be an iterator over tuples containing the start and end indices for each match in the string
let result = regex.captures_iter(string);
for mat in result {
println!("{:?}", mat);
}
}
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for Rust, please visit: https://docs.rs/regex/latest/regex/