<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Bahramov's Personal Blog &#187; Regular Expressions</title>
	<atom:link href="http://www.bahramov.com/tag/regular-expressions/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.bahramov.com</link>
	<description>Computers, databases, networks and virtualization</description>
	<lastBuildDate>Wed, 28 Apr 2010 12:24:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
		<item>
		<title>Matching IP Address using the Regular Expression</title>
		<link>http://www.bahramov.com/2009/10/15/matching-ip-address-using-the-regular-expression/#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed</link>
		<comments>http://www.bahramov.com/2009/10/15/matching-ip-address-using-the-regular-expression/#comments</comments>
		<pubDate>Thu, 15 Oct 2009 20:18:21 +0000</pubDate>
		<dc:creator>Zaur Bahramov</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Regular Expressions]]></category>

		<guid isPermaLink="false">http://www.bahramov.com/2009/10/15/matching-ip-address-using-the-regular-expression/</guid>
		<description><![CDATA[This example demonstrates the quick and simple way to match correct IP address.
MatchesDemo.zip




 using System;
 using System.Collections.Generic;
 using System.ComponentModel;
 using System.Data;
 using System.Drawing;
 using System.Linq;
 using System.Text;
 using System.Text.RegularExpressions;
 using System.Windows.Forms;

 namespace MatchesDemo
 {
     public partial class IPValidate : Form
     {
       [...]]]></description>
			<content:encoded><![CDATA[<p>This example demonstrates the quick and simple way to match correct IP address.</p>
<p><a target="_self" href="http://www.snippetware.com/wp-content/uploads/2009/10/MatchesDemo1.zip">MatchesDemo.zip</a></p>
<p><a href="http://www.snippetware.com/wp-content/uploads/2009/10/ipOK1.png" rel="shadowbox[post-470];player=img;" title="ipOK"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="ipOK" border="0" alt="ipOK" height="167" width="427" src="http://www.snippetware.com/wp-content/uploads/2009/10/ipOK_thumb1.png" /></a></p>
<p><a href="http://www.snippetware.com/wp-content/uploads/2009/10/ipBad1.png" rel="shadowbox[post-470];player=img;" title="ipBad"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="ipBad" border="0" alt="ipBad" height="168" width="427" src="http://www.snippetware.com/wp-content/uploads/2009/10/ipBad_thumb1.png" /></a></p>
<p>
<pre class="brush: csharp">
 using System;
 using System.Collections.Generic;
 using System.ComponentModel;
 using System.Data;
 using System.Drawing;
 using System.Linq;
 using System.Text;
 using System.Text.RegularExpressions;
 using System.Windows.Forms;

 namespace MatchesDemo
 {
     public partial class IPValidate : Form
     {
         public IPValidate()
         {
             InitializeComponent();
         }

         private void btnValidate_Click(object sender, EventArgs e)
         {
             // MessageBox.Show(mtxtIPAddress.Text);

             // create a regex object
             Regex checkIP = new Regex (@&amp;quot;\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b&amp;quot;);

             // create match
             Match matchIP = checkIP.Match(mtxtIPAddress.Text);

             if (checkIP.IsMatch(mtxtIPAddress.Text))
             {
                 mtxtIPAddress.ForeColor = Color.Green;
             }
             else
                 mtxtIPAddress.ForeColor = Color.Red;
         }
     }
 }
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.bahramov.com/2009/10/15/matching-ip-address-using-the-regular-expression/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
