示例#1
0
        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).");
        }
示例#2
0
        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));
        }
示例#3
0
        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);
            }
        }
示例#4
0
        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.");
            }
        }