Gr(a|e)y : Regular Expression : Development Class C# Source Code


Custom Search

C# Source Code » Development Class » Regular Expression »

 

Gr(a|e)y








    
 

using System;
using System.Text.RegularExpressions;


public class MainClass {
    public static void Main() {

        Regex n = new Regex("Gr(a|e)y");
        MatchCollection mp = n.Matches("Green, Grey, Granite, Gray");
        for (int i = 0; i < mp.Count; i++) {
            Console.WriteLine("Found '{0}' at position {1}",mp[i].Value, mp[i].Index);
        }
    }
}

 
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo Development Class
» Regular Expression