Use | to combine different case : Regular Expression : Development Class C# Source Code


Custom Search

C# Source Code » Development Class » Regular Expression »

 

Use | to combine different case








    
 

using System;
using System.Text.RegularExpressions;


class RXOptionsApp {
    static void Main(string[] args) {
        Regex r = new Regex("in|In|IN|iN");
        string s = "The KING Was In His Counting House";
        MatchCollection mc = r.Matches(s);
        for (int i = 0; i < mc.Count; i++) {
            Console.WriteLine("Found '{0}' at position {1}",mc[i].Value, mc[i].Index);
        }
    }
}

 
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo Development Class
» Regular Expression