((an)|(in)|(on)) : Regular Expression « Development Class « C# / C Sharp
- C# / C Sharp
- Development Class
- Regular Expression
((an)|(in)|(on))
using System;
using System.Text.RegularExpressions;
public class MainClass {
public static void Main() {
Regex p = new Regex("((an)|(in)|(on))");
MatchCollection mn = p.Matches("King, Kong Kang");
for (int i = 0; i < mn.Count; i++) {
Console.WriteLine("Found '{0}' at position {1}",mn[i].Value, mn[i].Index);
}
}
}
Related examples in the same category