Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Text.RegularExpressions;
- namespace Лаба_8
- {
- internal class Program
- {
- static void Main(string[] args)
- {
- TryAgain:
- Console.Write("Введите идентификатор цвета в HTML: ");
- string line = Console.ReadLine();
- Regex regex = new Regex(@"^#([0-9A-Fa-f]){6}$");
- Console.WriteLine("{0} {1}индетификатор цвета",line, regex.IsMatch(line) ? "" : "не ");
- if (regex.IsMatch(line) == false)
- {
- Console.WriteLine("Ошибка при вводе идентификатора, повторите!\n");
- goto TryAgain;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement