Advertisement
afterlife88

Untitled

Apr 9th, 2016
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.48 KB | None | 0 0
  1. using System;
  2. using System.Text.RegularExpressions;
  3.  
  4. namespace ConsoleApplication1
  5. {
  6.     class Program
  7.     {
  8.         static void Main(string[] args)
  9.         {
  10.             string txt = "rgb(139, 0, 0) none repeat scroll 0% 0% / auto padding-box border-box";
  11.  
  12.             Regex r = new Regex("(rgb)+(\\(.*\\))");
  13.             Match m = r.Match(txt);
  14.             if (m.Success)
  15.             {
  16.                 var word1 = m.Groups[1].ToString();
  17.                 var word2 = m.Groups[2].ToString();
  18.                 Console.Write(word1+ word2);
  19.             }
  20.             Console.ReadLine();
  21.         }
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement