public static void ConsoleInterface() { RegularExpressionsCheck regularExpressionsCheck = new RegularExpressionsCheck(); string text = CommonConsoleUI.GetString("This program displays the count of time contained in a text. " + Environment.NewLine + "Enter text that contains time: ", "This string is empty. Enter another string."); Console.WriteLine($"Time appears in the text {regularExpressionsCheck.TimeCount(text)} time(s)."); }
public static void ConsoleInterface() { RegularExpressionsCheck regularExpressionsCheck = new RegularExpressionsCheck(); string text = CommonConsoleUI.GetString("This program replaces all html tags in entered text. " + Environment.NewLine + "Enter text that contains html tag(s): ", "This string is empty. Enter another string."); Console.WriteLine(Environment.NewLine + "Replace result: " + regularExpressionsCheck.RemoveHtmlTags(text)); }
public static void ConsoleInterface() { RegularExpressionsCheck regularExpressionsCheck = new RegularExpressionsCheck(); string text = CommonConsoleUI.GetString("This program displays all emails found in an entered text. " + Environment.NewLine + "Enter text that contains email(s): ", "This string is empty. Enter another string."); Console.WriteLine(Environment.NewLine + "Emails found: "); MatchCollection emails = regularExpressionsCheck.GetEmails(text); foreach (Match item in emails) { Console.WriteLine(item); } }
public static void ConsoleInterface() { RegularExpressionsCheck regularExpressionsCheck = new RegularExpressionsCheck(); string text = CommonConsoleUI.GetString("This program displays notation type of entered real number. " + Environment.NewLine + "Enter a real number: ", "This string is empty. Enter another string."); if (regularExpressionsCheck.IsCommonRealNumber(text)) { Console.WriteLine("The number is in the common notation."); } else if (regularExpressionsCheck.IsScientificRealNumber(text)) { Console.WriteLine("The number is in the scientific notation."); } else { Console.WriteLine("This is not a number."); } }