<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-3592741696952632034</id><updated>2011-11-27T15:45:17.188-08:00</updated><category term='asp.net'/><category term='Multiline'/><category term='TextBox'/><category term='regular expression'/><category term='System.Web.UI.WebControls'/><category term='web form'/><category term='MaxLength'/><category term='asp:RegularExpressionValidator'/><title type='text'>.Net Focus</title><subtitle type='html'>Microsoft .Net World</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://dotnetfocus.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3592741696952632034/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://dotnetfocus.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Khurram Shahzad</name><uri>http://www.blogger.com/profile/14784746834758020183</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>3</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3592741696952632034.post-1906305735857368853</id><published>2009-09-16T03:04:00.000-07:00</published><updated>2009-09-16T04:14:33.826-07:00</updated><title type='text'>.Net Regular Expression Tutorial - Part 1 (Basics)</title><content type='html'>&lt;div style="width: 95%; font-family: verdana; font-size: 14px; text-decoration: none;&lt;br /&gt;        margin: 8px;"&gt;         &lt;br /&gt;         &lt;div style="padding-bottom: 0px; margin-bottom: 4px; color: #009900; font-weight: bold;&lt;br /&gt;            font-size: 14px;"&gt;What is Regular Expression?&lt;/div&gt;&lt;br /&gt;        It is a way of representing data using symbols. They are often used within matching,&lt;br /&gt;        searching or replacing algorithms.The term regular expression is often abbreviated&lt;br /&gt;        to regex or RE, RegEx or RegExp.&lt;br /&gt;&lt;br/&gt;In this series of tutorials i will start from basic operations or Regular Expression&lt;br /&gt;        to more complex one with .Net C# code example. Hopefully you will find it very easy&lt;br /&gt;        to learn.&lt;br/&gt;&lt;br/&gt;&lt;div style="padding-bottom: 0px; margin-bottom: 4px; color: #009900; font-weight: bold;&lt;br /&gt;            font-size: 14px;"&gt;String Replacement with Case Sensitive and Insensitive Options&lt;/div&gt;&lt;br /&gt;        I am mentioning this basic replace functionality of Regular Expression class. Though&lt;br /&gt;        we have a replace functionality with String class. But problem with the lateral&lt;br /&gt;        is that it is case sensitive and if you need to do replacement with case insensitive you need to do a workaround. RegEx class provide us with a static method with parameter for Case ignoring. Following code shows difference between case sensitive options.&lt;pre style=" color: #3366CC;"&gt;                             &lt;br /&gt;string text = "This is DotNetFocus blog. DotNetfocus blog is resource for ASP.NET.";&lt;br /&gt;string pattern = "DotNetFocus"; //Simple string to match. keeping things simple in the start.&lt;br /&gt;string replacewith = "MyBlog";&lt;br /&gt;&lt;br /&gt;string updated = Regex.Replace(text, pattern, replacewith, RegexOptions.None);&lt;br /&gt;Console.WriteLine(updated); //Output-&gt; This is MyBlog blog. DotNetfocus blog is resource for ASP.NET.&lt;br /&gt;&lt;br /&gt;updated = Regex.Replace(text, pattern, replacewith, RegexOptions.IgnoreCase);&lt;br /&gt;Console.WriteLine(updated); //Output-&gt; This is MyBlog blog. MyBlog blog is resource for ASP.NET.&lt;br /&gt;&lt;/pre&gt; &lt;br /&gt;        &lt;div style="font-size: 10px; color: #33CC33; font-weight: bold; letter-spacing: 1px;"&gt;&lt;br /&gt;            Your feedback is an encourgement to write more.&lt;/div&gt;&lt;br /&gt;    &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3592741696952632034-1906305735857368853?l=dotnetfocus.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetfocus.blogspot.com/feeds/1906305735857368853/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dotnetfocus.blogspot.com/2009/09/net-regular-expression-tutorial-part-1.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3592741696952632034/posts/default/1906305735857368853'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3592741696952632034/posts/default/1906305735857368853'/><link rel='alternate' type='text/html' href='http://dotnetfocus.blogspot.com/2009/09/net-regular-expression-tutorial-part-1.html' title='.Net Regular Expression Tutorial - Part 1 (Basics)'/><author><name>Khurram Shahzad</name><uri>http://www.blogger.com/profile/14784746834758020183</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3592741696952632034.post-1420766209763702634</id><published>2009-08-18T08:00:00.000-07:00</published><updated>2009-08-18T08:01:42.468-07:00</updated><title type='text'>Remove carriage return line feed in T-SQL (SQL Server)</title><content type='html'>&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;Remove carriage return, line feed and tab in T-SQL..&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span class="Apple-style-span"  style="color:#3333FF;"&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;REPLACE(REPLACE(REPLACE(MyField, CHAR(10), ''), CHAR(13), ''), CHAR(9), '')&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;span class="Apple-style-span"  style="font-family:verdana;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Hope this will help&lt;/span&gt;..&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3592741696952632034-1420766209763702634?l=dotnetfocus.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetfocus.blogspot.com/feeds/1420766209763702634/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dotnetfocus.blogspot.com/2009/08/remove-carriage-return-line-feed-in-t.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3592741696952632034/posts/default/1420766209763702634'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3592741696952632034/posts/default/1420766209763702634'/><link rel='alternate' type='text/html' href='http://dotnetfocus.blogspot.com/2009/08/remove-carriage-return-line-feed-in-t.html' title='Remove carriage return line feed in T-SQL (SQL Server)'/><author><name>Khurram Shahzad</name><uri>http://www.blogger.com/profile/14784746834758020183</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3592741696952632034.post-5488054613455621049</id><published>2009-08-01T01:26:00.001-07:00</published><updated>2009-08-01T03:51:38.022-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='TextBox'/><category scheme='http://www.blogger.com/atom/ns#' term='regular expression'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='MaxLength'/><category scheme='http://www.blogger.com/atom/ns#' term='web form'/><category scheme='http://www.blogger.com/atom/ns#' term='Multiline'/><category scheme='http://www.blogger.com/atom/ns#' term='System.Web.UI.WebControls'/><category scheme='http://www.blogger.com/atom/ns#' term='asp:RegularExpressionValidator'/><title type='text'>System.Web.UI.WebControls.TextBox Maxlength doest not work when TextMode is set to Multiline</title><content type='html'>&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;Hi,&lt;/span&gt;&lt;/span&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;This is known issue in ASP.NET Standard Text box control when set its TextMode="MultiLine" the MaxLength property does not work. &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;There is a workaround to accomplish this using RegularExpressionValidator. Following is the markup that will restrict the text box to maximum of 500 characters.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="color:#CC0000;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;asp:TextBox &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;ID="txtComments" runat="server" TextMode="MultiLine" Height="100px" &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;        Width="320px" MaxLength="10"&amp;gt;&amp;lt;/&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="color:#CC0000;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;asp:TextBox&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&amp;gt; &amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="color:#CC0000;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;asp:RegularExpressionValidator &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;        ID="regComments" runat="server" ControlToValidate="txtComments" &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;        ValidationExpression="^[\s\S]{0,500}$" ErrorMessage="Maximum 500 characters are  allowed in comments box." Text="Maximum 500 characters are allowed in comments &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;        box." &amp;gt; &amp;lt;/&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="color:#CC0000;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;asp:RegularExpressionValidator&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;Hope this will help,&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;Khurram&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3592741696952632034-5488054613455621049?l=dotnetfocus.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dotnetfocus.blogspot.com/feeds/5488054613455621049/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dotnetfocus.blogspot.com/2009/08/systemwebuiwebcontrolstextbox-maxlength.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3592741696952632034/posts/default/5488054613455621049'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3592741696952632034/posts/default/5488054613455621049'/><link rel='alternate' type='text/html' href='http://dotnetfocus.blogspot.com/2009/08/systemwebuiwebcontrolstextbox-maxlength.html' title='System.Web.UI.WebControls.TextBox Maxlength doest not work when TextMode is set to Multiline'/><author><name>Khurram Shahzad</name><uri>http://www.blogger.com/profile/14784746834758020183</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
