Introduction
Guys , we all know that regular expressions are very useful for checking any kind of patterns.
Background
So we have to know how to write regular expressions for our patterns. But don't worry here i will provide some but very useful regular expressions which will be useful for our coding.
Using the code
just copy and paste Regular Expression from here to your code.
<tt class="regex"><TAG\b[^>]*>(.*?)</TAG></tt>
<tt class="regex"><([A-Z][A-Z0-9]*)\b[^>]*>(.*?)</\1></tt>
<tt class="regex">^[ \t]+|[ \t]+$</tt>
<tt class="regex">\b(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.</tt><tt class="regex">(25[0-5]|2[0-4][0-9]|[01]?[0-9]</tt>
<tt class="regex">[0-9]?)\.</tt><tt class="regex">(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.</tt><tt class="regex">
<tt class="regex">(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b</tt><tt class="regex"><tt class="regex"><tt class="regex">
<tt class="regex">[-+]?[0-9]*\.?[0-9]+</tt>
<tt class="regex">[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?</tt><tt class="regex">
<tt class="regex">^[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$</tt></tt></tt></tt></tt></tt>
<tt class="regex"><tt class="regex"><tt class="regex"><tt class="regex"><tt class="regex"><tt class="regex">
<tt class="regex"><tt class="regex"><tt class="regex"><tt class="regex"><tt class="regex"><tt class="regex">^[A-Z0-9._%-]+@[A-Z0-9.-]+\.(?:[A-Z]{2}|com|org|net|biz|info|name|aero|biz|info|jobs|museum|name)$</tt></tt></tt></tt></tt></tt>
<tt class="regex"><tt class="regex"><tt class="regex"><tt class="regex"><tt class="regex"><tt class="regex">
<tt class="regex">(19|20)\d\d[- /.](0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])</tt>
<tt class="regex">
<tt class="regex">(0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])[- /.](19|20)\d\d</tt><tt class="regex"> <tt class="regex">
<tt class="regex">(0[1-9]|[12][0-9]|3[01])[- /.](0[1-9]|1[012])[- /.](19|20)\d\d</tt>
<tt class="regex">^.*\b(one|two|three)\b.*$
<tt class="regex">^(.*)(\r?\n\1)+$</tt></tt></tt></tt></tt></tt></tt></tt></tt>
^[0-9]
^[a-z]</tt>
<tt class="regex">
<tt class="regex">
^[4]([0-9]{15}$|[0-9]{12}$)
^[5][1-5][0-9]{14}$
^6011-?\\d{4}-?\\d{4}-?\\d{4}$
(^30[0-5][0-9]{11}$)|(^(36|38)[0-9]{12}$)
^[34|37][0-9]{14}$</tt>
<tt class="regex">
^(2014|2149)[0-9]{11}$
^3[0-9]{15}$)|(^(2131|1800)[0-9]{11}$)</tt>
Points of Interest
I like to Share my knowledge with you, because i am also one of you, taht if i don't know anything then i come to you...so keep excahnge of knowledge...
History
Chirag Patel, a Programmer Analyst in a well known IT company working on .NET Technologies since last 2 years. He is interested in Pure business logic and fuzzy logic. his area of interest is in C#.NET, VB.NET and MSSQL 2005.
catch me on: http://groups.google.com/group/codewar