<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
		<id>http://nfex.ru/index.php?action=history&amp;feed=atom&amp;title=Csharp%2FCSharp_Tutorial%2FRegular_Expression%2FRegex_Match</id>
		<title>Csharp/CSharp Tutorial/Regular Expression/Regex Match - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://nfex.ru/index.php?action=history&amp;feed=atom&amp;title=Csharp%2FCSharp_Tutorial%2FRegular_Expression%2FRegex_Match"/>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=Csharp/CSharp_Tutorial/Regular_Expression/Regex_Match&amp;action=history"/>
		<updated>2026-04-29T16:10:23Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://nfex.ru/index.php?title=Csharp/CSharp_Tutorial/Regular_Expression/Regex_Match&amp;diff=5918&amp;oldid=prev</id>
		<title> в 15:31, 26 мая 2010</title>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=Csharp/CSharp_Tutorial/Regular_Expression/Regex_Match&amp;diff=5918&amp;oldid=prev"/>
				<updated>2010-05-26T15:31:53Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Версия 15:31, 26 мая 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;text-align: center;&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
			</entry>

	<entry>
		<id>http://nfex.ru/index.php?title=Csharp/CSharp_Tutorial/Regular_Expression/Regex_Match&amp;diff=5919&amp;oldid=prev</id>
		<title>Admin: 1 версия</title>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=Csharp/CSharp_Tutorial/Regular_Expression/Regex_Match&amp;diff=5919&amp;oldid=prev"/>
				<updated>2010-05-26T12:17:44Z</updated>
		
		<summary type="html">&lt;p&gt;1 версия&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Capture Collection==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;using System;&lt;br /&gt;
using System.Text.RegularExpressions;&lt;br /&gt;
    class Test&lt;br /&gt;
    {&lt;br /&gt;
        public static void Main()&lt;br /&gt;
        {&lt;br /&gt;
            string string1 = &amp;quot;04:03:27 abc 0.0.0.127 def&amp;quot;;&lt;br /&gt;
            Regex theReg = new Regex(@&amp;quot;(?&amp;lt;time&amp;gt;(\d|\:)+)\s&amp;quot; +&lt;br /&gt;
                            @&amp;quot;(?&amp;lt;company&amp;gt;\S+)\s&amp;quot; +&lt;br /&gt;
                            @&amp;quot;(?&amp;lt;ip&amp;gt;(\d|\.)+)\s&amp;quot; +&lt;br /&gt;
                            @&amp;quot;(?&amp;lt;company&amp;gt;\S+)\s&amp;quot;);&lt;br /&gt;
            MatchCollection theMatches = theReg.Matches(string1);&lt;br /&gt;
            foreach (Match theMatch in theMatches)&lt;br /&gt;
            {&lt;br /&gt;
                if (theMatch.Length != 0)&lt;br /&gt;
                {&lt;br /&gt;
                    Console.WriteLine(&amp;quot;theMatch: {0}&amp;quot;,theMatch.ToString());&lt;br /&gt;
                    Console.WriteLine(&amp;quot;time: {0}&amp;quot;,theMatch.Groups[&amp;quot;time&amp;quot;]);&lt;br /&gt;
                    Console.WriteLine(&amp;quot;ip: {0}&amp;quot;,theMatch.Groups[&amp;quot;ip&amp;quot;]);&lt;br /&gt;
                    Console.WriteLine(&amp;quot;Company: {0}&amp;quot;,theMatch.Groups[&amp;quot;company&amp;quot;]);&lt;br /&gt;
                    foreach (Capture cap in theMatch.Groups[&amp;quot;company&amp;quot;].Captures)&lt;br /&gt;
                    {&lt;br /&gt;
                        Console.WriteLine(&amp;quot;cap: {0}&amp;quot;, cap.ToString());&lt;br /&gt;
                    }&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Get matched parts==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;using System;&lt;br /&gt;
using System.Text.RegularExpressions;&lt;br /&gt;
public class EntryPoint&lt;br /&gt;
{&lt;br /&gt;
    static void Main( string[] args ) {&lt;br /&gt;
        // Create regex to search for IP address pattern.&lt;br /&gt;
        string pattern = @&amp;quot;(?&amp;lt;part1&amp;gt;[01]?\d\d?|2[0-4]\d|25[0-5])\.&amp;quot; +&lt;br /&gt;
                         @&amp;quot;(?&amp;lt;part2&amp;gt;[01]?\d\d?|2[0-4]\d|25[0-5])\.&amp;quot; +&lt;br /&gt;
                         @&amp;quot;(?&amp;lt;part3&amp;gt;[01]?\d\d?|2[0-4]\d|25[0-5])\.&amp;quot; +&lt;br /&gt;
                         @&amp;quot;(?&amp;lt;part4&amp;gt;[01]?\d\d?|2[0-4]\d|25[0-5])&amp;quot;;&lt;br /&gt;
        Regex regex = new Regex( pattern );&lt;br /&gt;
        Match match = regex.Match( &amp;quot;192.168.169.1&amp;quot; );&lt;br /&gt;
        while( match.Success ) {&lt;br /&gt;
            Console.WriteLine( &amp;quot;IP Address found at {0} with &amp;quot; +&lt;br /&gt;
                               &amp;quot;value of {1}&amp;quot;,&lt;br /&gt;
                               match.Index,&lt;br /&gt;
                               match.Value );&lt;br /&gt;
            Console.WriteLine( &amp;quot;Groups are:&amp;quot; );&lt;br /&gt;
            Console.WriteLine( &amp;quot;\tPart 1: {0}&amp;quot;,&lt;br /&gt;
                               match.Groups[&amp;quot;part1&amp;quot;] );&lt;br /&gt;
            Console.WriteLine( &amp;quot;\tPart 2: {0}&amp;quot;,&lt;br /&gt;
                               match.Groups[&amp;quot;part2&amp;quot;] );&lt;br /&gt;
            Console.WriteLine( &amp;quot;\tPart 3: {0}&amp;quot;,&lt;br /&gt;
                               match.Groups[&amp;quot;part3&amp;quot;] );&lt;br /&gt;
            Console.WriteLine( &amp;quot;\tPart 4: {0}&amp;quot;,&lt;br /&gt;
                               match.Groups[&amp;quot;part4&amp;quot;] );&lt;br /&gt;
            match = match.NextMatch();&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;pre class=codeResult&amp;gt;IP Address found at 0 with value of 192.168.169.1&lt;br /&gt;
Groups are:&lt;br /&gt;
        Part 1: 192&lt;br /&gt;
        Part 2: 168&lt;br /&gt;
        Part 3: 169&lt;br /&gt;
        Part 4: 1&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Match index and value==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;using System;&lt;br /&gt;
using System.Text.RegularExpressions;&lt;br /&gt;
public class MainClass&lt;br /&gt;
{&lt;br /&gt;
    static void Main( string[] args ) {&lt;br /&gt;
        // Create regex to search for IP address pattern.&lt;br /&gt;
        string pattern = @&amp;quot;(?&amp;lt;part1&amp;gt;[01]?\d\d?|2[0-4]\d|25[0-5])\.&amp;quot; +&lt;br /&gt;
                         @&amp;quot;\k&amp;lt;part1&amp;gt;\.&amp;quot; +&lt;br /&gt;
                         @&amp;quot;\k&amp;lt;part1&amp;gt;\.&amp;quot; +&lt;br /&gt;
                         @&amp;quot;\k&amp;lt;part1&amp;gt;&amp;quot;;&lt;br /&gt;
        Regex regex = new Regex( pattern );&lt;br /&gt;
        Match match = regex.Match( &amp;quot;192.168.169.1&amp;quot; );&lt;br /&gt;
        while( match.Success ) {&lt;br /&gt;
            Console.WriteLine( &amp;quot;IP Address found at {0} with &amp;quot; +&lt;br /&gt;
                               &amp;quot;value of {1}&amp;quot;,&lt;br /&gt;
                               match.Index,&lt;br /&gt;
                               match.Value );&lt;br /&gt;
            match = match.NextMatch();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Match words that contain any letters in the range &amp;quot;b&amp;quot; through &amp;quot;d&amp;quot;==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;using System;&lt;br /&gt;
using System.Text.RegularExpressions;&lt;br /&gt;
class MainClass {&lt;br /&gt;
  private static void DisplayMatches(string text,string regularExpressionString) {&lt;br /&gt;
    Console.WriteLine(&amp;quot;using the following regular expression: &amp;quot; +regularExpressionString);&lt;br /&gt;
    MatchCollection myMatchCollection = Regex.Matches(text, regularExpressionString);&lt;br /&gt;
    foreach (Match myMatch in myMatchCollection) {&lt;br /&gt;
      Console.WriteLine(myMatch);&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
  public static void Main() {&lt;br /&gt;
    string text =&amp;quot;knife knock five&amp;quot;;&lt;br /&gt;
    &lt;br /&gt;
    Console.WriteLine(&amp;quot;Matching words that contain any letters in the range &amp;quot;b&amp;quot; through &amp;quot;d&amp;quot;&amp;quot;);&lt;br /&gt;
    DisplayMatches(text, @&amp;quot;\S*[b-d]\S*&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;pre class=codeResult&amp;gt;Matching words that contain any letters in the range &amp;quot;b&amp;quot; through &amp;quot;d&amp;quot;&lt;br /&gt;
using the following regular expression: \S*[b-d]\S*&lt;br /&gt;
knock&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Match words that contain &amp;quot;k&amp;quot; or &amp;quot;f&amp;quot;==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;using System;&lt;br /&gt;
using System.Text.RegularExpressions;&lt;br /&gt;
class MainClass {&lt;br /&gt;
  private static void DisplayMatches(string text,string regularExpressionString) {&lt;br /&gt;
    Console.WriteLine(&amp;quot;using the following regular expression: &amp;quot; +regularExpressionString);&lt;br /&gt;
    MatchCollection myMatchCollection = Regex.Matches(text, regularExpressionString);&lt;br /&gt;
    foreach (Match myMatch in myMatchCollection) {&lt;br /&gt;
      Console.WriteLine(myMatch);&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
  public static void Main() {&lt;br /&gt;
    string text =&amp;quot;knife knock five&amp;quot;;&lt;br /&gt;
    &lt;br /&gt;
    Console.WriteLine(&amp;quot;Matching words that contain &amp;quot;k&amp;quot; or &amp;quot;f&amp;quot;&amp;quot;);&lt;br /&gt;
    DisplayMatches(text, @&amp;quot;\S*[kf]\S*&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;pre class=codeResult&amp;gt;Matching words that contain &amp;quot;k&amp;quot; or &amp;quot;f&amp;quot;&lt;br /&gt;
using the following regular expression: \S*[kf]\S*&lt;br /&gt;
knife&lt;br /&gt;
knock&lt;br /&gt;
five&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Match words that contain the pattern &amp;quot;ai&amp;quot;==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;using System;&lt;br /&gt;
using System.Text.RegularExpressions;&lt;br /&gt;
class MainClass {&lt;br /&gt;
  private static void DisplayMatches(string text,string regularExpressionString) {&lt;br /&gt;
    Console.WriteLine(&amp;quot;using the following regular expression: &amp;quot; +regularExpressionString);&lt;br /&gt;
    MatchCollection myMatchCollection = Regex.Matches(text, regularExpressionString);&lt;br /&gt;
    foreach (Match myMatch in myMatchCollection) {&lt;br /&gt;
      Console.WriteLine(myMatch);&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
  public static void Main() {&lt;br /&gt;
    string text =&amp;quot;put curtain pertain perday&amp;quot;;&lt;br /&gt;
    &lt;br /&gt;
    Console.WriteLine(&amp;quot;Matching words that contain the pattern &amp;quot;ai&amp;quot;&amp;quot;);&lt;br /&gt;
    DisplayMatches(text, @&amp;quot;\S*(ai)\S*&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;pre class=codeResult&amp;gt;Matching words that contain the pattern &amp;quot;ai&amp;quot;&lt;br /&gt;
using the following regular expression: \S*(ai)\S*&lt;br /&gt;
curtain&lt;br /&gt;
pertain&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Match words that contain the pattern &amp;quot;ai&amp;quot; or &amp;quot;ie&amp;quot;==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;using System;&lt;br /&gt;
using System.Text.RegularExpressions;&lt;br /&gt;
class MainClass {&lt;br /&gt;
  private static void DisplayMatches(string text,string regularExpressionString) {&lt;br /&gt;
    Console.WriteLine(&amp;quot;using the following regular expression: &amp;quot; +regularExpressionString);&lt;br /&gt;
    MatchCollection myMatchCollection = Regex.Matches(text, regularExpressionString);&lt;br /&gt;
    foreach (Match myMatch in myMatchCollection) {&lt;br /&gt;
      Console.WriteLine(myMatch);&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
  public static void Main() {&lt;br /&gt;
    string text =&amp;quot;put curtain pertain peiu&amp;quot;;&lt;br /&gt;
    &lt;br /&gt;
    Console.WriteLine(&amp;quot;Matching words that contain the pattern &amp;quot;ai&amp;quot; or &amp;quot;ie&amp;quot;&amp;quot;);&lt;br /&gt;
    DisplayMatches(text, @&amp;quot;\S*(ai|ie)\S*&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;pre class=codeResult&amp;gt;Matching words that contain the pattern &amp;quot;ai&amp;quot; or &amp;quot;ie&amp;quot;&lt;br /&gt;
using the following regular expression: \S*(ai|ie)\S*&lt;br /&gt;
curtain&lt;br /&gt;
pertain&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Match words that contain two consecutive identical characters==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;using System;&lt;br /&gt;
using System.Text.RegularExpressions;&lt;br /&gt;
class MainClass {&lt;br /&gt;
  private static void DisplayMatches(string text,string regularExpressionString) {&lt;br /&gt;
    Console.WriteLine(&amp;quot;using the following regular expression: &amp;quot; +regularExpressionString);&lt;br /&gt;
    MatchCollection myMatchCollection = Regex.Matches(text, regularExpressionString);&lt;br /&gt;
    foreach (Match myMatch in myMatchCollection) {&lt;br /&gt;
      Console.WriteLine(myMatch);&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
  public static void Main() {&lt;br /&gt;
    string text =&amp;quot;Missisipli Kerrisdale she&amp;quot;;&lt;br /&gt;
    &lt;br /&gt;
    Console.WriteLine(&amp;quot;Matching words that that contain two consecutive identical characters&amp;quot;);&lt;br /&gt;
    DisplayMatches(text, @&amp;quot;\S*(.)\1\S*&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;pre class=codeResult&amp;gt;Matching words that that contain two consecutive identical characters&lt;br /&gt;
using the following regular expression: \S*(.)\1\S*&lt;br /&gt;
Missisipli&lt;br /&gt;
Kerrisdale&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Match words that contain &amp;quot;u&amp;quot;==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;using System;&lt;br /&gt;
using System.Text.RegularExpressions;&lt;br /&gt;
class MainClass {&lt;br /&gt;
  private static void DisplayMatches(string text,string regularExpressionString) {&lt;br /&gt;
    Console.WriteLine(&amp;quot;using the following regular expression: &amp;quot; +regularExpressionString);&lt;br /&gt;
    MatchCollection myMatchCollection = Regex.Matches(text, regularExpressionString);&lt;br /&gt;
    foreach (Match myMatch in myMatchCollection) {&lt;br /&gt;
      Console.WriteLine(myMatch);&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
  public static void Main() {&lt;br /&gt;
    string text =&amp;quot;put public private she&amp;quot;;&lt;br /&gt;
    &lt;br /&gt;
    Console.WriteLine(&amp;quot;Matching words that contain &amp;quot;u&amp;quot;&amp;quot;);&lt;br /&gt;
    DisplayMatches(text, @&amp;quot;\S*u+\S*&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;pre class=codeResult&amp;gt;Matching words that contain &amp;quot;u&amp;quot;&lt;br /&gt;
using the following regular expression: \S*u+\S*&lt;br /&gt;
put&lt;br /&gt;
public&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Match words that start with &amp;quot;s&amp;quot;==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;using System;&lt;br /&gt;
using System.Text.RegularExpressions;&lt;br /&gt;
class MainClass {&lt;br /&gt;
  private static void DisplayMatches(string text,string regularExpressionString) {&lt;br /&gt;
    Console.WriteLine(&amp;quot;using the following regular expression: &amp;quot; +regularExpressionString);&lt;br /&gt;
    MatchCollection myMatchCollection = Regex.Matches(text, regularExpressionString);&lt;br /&gt;
    foreach (Match myMatch in myMatchCollection) {&lt;br /&gt;
      Console.WriteLine(myMatch);&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
  public static void Main() {&lt;br /&gt;
    string text =&amp;quot;end main void static start she&amp;quot;;&lt;br /&gt;
    &lt;br /&gt;
    Console.WriteLine(&amp;quot;Matching words that start with &amp;quot;s&amp;quot;&amp;quot;);&lt;br /&gt;
    DisplayMatches(text, @&amp;quot;\bs\S*&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;pre class=codeResult&amp;gt;Matching words that start with &amp;quot;s&amp;quot;&lt;br /&gt;
using the following regular expression: \bs\S*&lt;br /&gt;
static&lt;br /&gt;
start&lt;br /&gt;
she&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Match words that start with &amp;quot;s&amp;quot; and end with &amp;quot;e&amp;quot;==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;using System;&lt;br /&gt;
using System.Text.RegularExpressions;&lt;br /&gt;
class MainClass {&lt;br /&gt;
  private static void DisplayMatches(string text,string regularExpressionString) {&lt;br /&gt;
    Console.WriteLine(&amp;quot;using the following regular expression: &amp;quot; +regularExpressionString);&lt;br /&gt;
    MatchCollection myMatchCollection = Regex.Matches(text, regularExpressionString);&lt;br /&gt;
    foreach (Match myMatch in myMatchCollection) {&lt;br /&gt;
      Console.WriteLine(myMatch);&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
  public static void Main() {&lt;br /&gt;
    string text =&amp;quot;end main void static start she&amp;quot;;&lt;br /&gt;
    &lt;br /&gt;
    Console.WriteLine(&amp;quot;Matching words that start with &amp;quot;s&amp;quot; and end with &amp;quot;e&amp;quot;&amp;quot;);&lt;br /&gt;
    DisplayMatches(text, @&amp;quot;\bs\S*e\b&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;pre class=codeResult&amp;gt;Matching words that start with &amp;quot;s&amp;quot; and end with &amp;quot;e&amp;quot;&lt;br /&gt;
using the following regular expression: \bs\S*e\b&lt;br /&gt;
she&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Next Match==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;using System;&lt;br /&gt;
using System.Collections.Generic;&lt;br /&gt;
using System.Globalization;&lt;br /&gt;
using System.Text;&lt;br /&gt;
using System.Text.RegularExpressions;&lt;br /&gt;
using System.Reflection;&lt;br /&gt;
public class MainClass{&lt;br /&gt;
   public static void Main(){&lt;br /&gt;
        Regex r = new Regex(@&amp;quot;^\G\d+$\n?&amp;quot;, RegexOptions.Multiline);&lt;br /&gt;
        Match m = r.Match(&amp;quot;13\n38\n18\n5&amp;quot;);&lt;br /&gt;
        do {&lt;br /&gt;
            Console.WriteLine(&amp;quot;Match: &amp;quot; + m.Value);&lt;br /&gt;
        } while ((m = m.NextMatch()).Success);&lt;br /&gt;
   }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;pre class=codeResult&amp;gt;Match: 13&lt;br /&gt;
Match: 38&lt;br /&gt;
Match: 18&lt;br /&gt;
Match: 5&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use Regex to validate your input==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;using System;&lt;br /&gt;
using System.Text.RegularExpressions;&lt;br /&gt;
class MainClass&lt;br /&gt;
{&lt;br /&gt;
    public static void Main(string[] args)&lt;br /&gt;
    {&lt;br /&gt;
        string regex = &amp;quot;your regex&amp;quot;; &lt;br /&gt;
        string input = &amp;quot;your input&amp;quot;;&lt;br /&gt;
        &lt;br /&gt;
        Regex r = new Regex(regex);&lt;br /&gt;
        Console.WriteLine(r.IsMatch(input));&lt;br /&gt;
        &lt;br /&gt;
        //or Regex.IsMatch(input, regex);&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;pre class=codeResult&amp;gt;False&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Using Match Collection==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;using System;&lt;br /&gt;
using System.Text.RegularExpressions;&lt;br /&gt;
    class Test&lt;br /&gt;
    {&lt;br /&gt;
        public static void Main()&lt;br /&gt;
        {&lt;br /&gt;
            string string1 = &amp;quot;This is a test string&amp;quot;;&lt;br /&gt;
            Regex theReg = new Regex(@&amp;quot;(\S+)\s&amp;quot;);&lt;br /&gt;
            MatchCollection theMatches = theReg.Matches(string1);&lt;br /&gt;
            foreach (Match theMatch in theMatches)&lt;br /&gt;
            {&lt;br /&gt;
                Console.WriteLine(theMatch.Length);&lt;br /&gt;
                if (theMatch.Length != 0)&lt;br /&gt;
                {&lt;br /&gt;
                    Console.WriteLine(&amp;quot;theMatch: {0}&amp;quot;,&lt;br /&gt;
                                  theMatch.ToString());&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	</feed>