Regex.Match : Regex « System.Text.RegularExpressions « C# / C Sharp by API






Regex.Match

 

using System;
using System.Collections.Generic;
using System.Globalization;
using System.Text;
using System.Text.RegularExpressions;
using System.Reflection;

public class MainClass{

   public static void Main(){
        Regex r1 = new Regex(@"((abc)*)x(\1)");
        string s1 = "abcabcabcxabc";
        Console.WriteLine(r1.IsMatch(s1) + "..." + r1.Match(s1).Value);
   }
}

   
  








Related examples in the same category

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