new Regex(String pattern) : Regex « System.Text.RegularExpressions « C# / C Sharp by API






new Regex(String pattern)

 



using System;
using System.Text.RegularExpressions;

class MainClass
{
    public static void Main()
    {
        string s = "A, B,cCCC, D";
        Regex regex = new Regex(@" |, ");
        foreach (string sub in regex.Split(s))
        {
            Console.WriteLine("Word: {0}", sub);
        }
    }
}

   
  








Related examples in the same category

1.Regex.CompileToAssembly
2.Regex.IsMatch
3.Regex.Match(String value,String pattern).Success
4.Regex.Replace
5.Regex.Match
6.Regex.Split