Full Site Version
using System;
using System.Text.RegularExpressions;
public class Program
{
public static void Main()
string regexPattern = @"hello";
Regex regex = new Regex(regexPattern);
string inputString = "hello world!";
Match match = regex.Match(inputString);
if (match.Success)
Console.WriteLine("Match found at index {0} with length {1}", match.Index, match.Length);
}
else
Console.WriteLine("No match found.");