using System;
using System.Text.RegularExpressions;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
  string txt="11:Jan:2019 \"This is an Example!\"";
  string re1="(\\d+)";
  string re2=".*?";
  string re3="[a-z]";
  string re4=".*?";
  string re5="[a-z]";
  string re6=".*?";
  string re7="[a-z]";
  string re8=".*?";
  string re9="[a-z]";
  string re10=".*?";
  string re11="([a-z])";
  Regex r = new Regex(re1+re2+re3+re4+re5+re6+re7+re8+re9+re10+re11,RegexOptions.IgnoreCase|RegexOptions.Singleline);
  Match m = r.Match(txt);
  if (m.Success)
  {
  String int1=m.Groups[1].ToString();
  String w1=m.Groups[2].ToString();
  Console.Write("("+int1.ToString()+")"+"("+w1.ToString()+")"+"\n");
  }
Console.ReadLine();
}
}
}
|