using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @"(&)('.$Key.')([^0-9a-zA-Z_])";
string input = @"<?php
// Сравниваем Куки Ñ Ð´Ð°Ð½Ð½Ñ‹Ð¼Ð¸
if ($_COOKIE['login'] == $admin_login AND $_COOKIE['password'] == md5($admin_pass))
{
If (isset($_POST['submit'])){
$date=explode(""."", date(""d.m.Y""));
switch ($date[1]){
case 1: $m='ÑнварÑ'; break;
case 2: $m='февралÑ'; break;
case 3: $m='марта'; break;
case 4: $m='апрелÑ'; break;
case 5: $m='маÑ'; break;
case 6: $m='июнÑ'; break;
case 7: $m='июлÑ'; break;
case 8: $m='авгуÑта'; break;
case 9: $m='ÑентÑбрÑ'; break;
case 10: $m='октÑбрÑ'; break;
case 11: $m='ноÑбрÑ'; break;
case 12: $m='декабрÑ'; break;
}
$createdata = $date[0].' '.$m.', '.$date[2];
$useradd = 'Admin';
$name = $_POST['amess'];
$useradd = $_POST['useradd'];
$text = $_POST['mess'];
$textkrat = $_POST['opisan'];
$title = $_POST['title'];
$description = $_POST['description'];
$keyword = $_POST['keywords'];
$url = $_POST['amessurl'];
$tegs = $_POST['tegs'];
?>";
Match m = Regex.Match(input, pattern);
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