using System;
using System.Text.RegularExpressions;
class Program
{
static void Main()
{
// Declare the regex pattern
string pattern = @"htt+p";
Regex regex = new Regex(pattern);
// Test strings
string[] testStrings = { "http", "htttp", "httttp", "httpp", "htp" };
// Check matches
foreach (string test in testStrings)
{
bool match = regex.IsMatch(test);
Console.WriteLine($"Matches \"{test}\": {match}");
}
}
}
// Matches "httpp": True or false, depending on how matches() method works
/*
run:
Matches "http": True
Matches "htttp": True
Matches "httttp": True
Matches "httpp": True
Matches "htp": False
*/