Full Site Version
using System;
using System.Text.RegularExpressions;
namespace HelloWorld
{
public class Program
public static void Main(string[] args)
try
string regexPattern = @"\hel#lo\m";
Regex regex = new Regex(regexPattern);
string inputString = "hello world!";
Match match = regex.Match(inputString);
if (match.Success)
Console.WriteLine("Match found.");
}
else
Console.WriteLine("No match found.");
catch (RegexMatchTimeoutException ex)
Console.WriteLine("Timeout Error: " + ex.Message);
catch (RegexParseException ex)
Console.WriteLine("Error in parsing regular expression: " + ex.Message);