You are not Logged in
Would you like to Login or Register

Today is: Friday, 21 November, 2008
Check this months hot topics

IP Address regular expression

string pattern = @"\b(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b"
 
kick it on DotNetKicks.com del.icio.us digg Mister Wong YahooMyWeb Reddit Furl Spurl blogmarks
Paul Hayman Skype
Author : Paul Hayman
Published : Friday, 04 August, 2006

Paul is the COO of kwiboo ltd consultant and has more than a decade of IT consultancy experience. He has consulted for a number of blue chip companies and has been exposed to the folowing sectors: Utilities, Telecommunications, Insurance, Media, Investment Banking, Leisure, Legal, CRM, Pharmaceuticals, Interactive Gaming, Mobile Communications, Online Services. Paul is the COO and co-founder of kwiboo (http://www.kwiboo.com/) and is also the creator of GeekZilla.

Comments

Shatheesh said:

Thanks... It works... :)

November 15, 2006 - 11:04 AM

kamal said:

Thanks for the Regex ..

Could you also include regular expression strings for other validations too,generally not found over net.

Thanks in advance!

July 05, 2007 - 8:11 AM

phayman said:

July 05, 2007 - 8:59 AM

Paul said:

It appears that the regex does not consider Ipv6

January 22, 2008 - 7:55 PM

masterik said:

I've found another one at http://www.regular-expressions.info/examples.html:

\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

March 14, 2008 - 10:30 AM

Wieland K said:

thank you! works great

May 20, 2008 - 11:37 PM

steve said:

Thanks. You saved me a lot of time and trouble!

July 11, 2008 - 1:22 PM

Add Comment

Enter your comment below and it will be submitted for moderation.

Your Name

Add Tag

Please enter tags for this article, seperated by semi-colon ;

View Tag's by : # articles | # views

More Publications

URL Regular Expression
Paul Hayman - 26/7/2006
IsGuid() (Regular Expression Guid Match)
Paul Hayman - 14/6/2006
IP Address regular expression
Paul Hayman - 4/8/2006
ISBN Number regular expression
Paul Hayman - 4/8/2006
Email Address Regular Expression
Paul Hayman - 26/7/2006