- The first Regular Expression Library on the Web!

Please support RegExLib Sponsors


Regular Expression Details

Title Test Find Pattern Title
Matches comma-separated list of IP address and IP ranges. E.g.,
Matches | |,
999.168.101.1 | | -
Author Rating: The rating for this expression. Gregory Entin
Your Rating
Bad Good

Enter New Comment

Spammers suck - we apologize. Please enter the text shown below to enable your comment (not case sensitive - try as many times as you need to if the first ones are too hard):

Existing User Comments

Title: Incomplete Regex
Name: Ravi
Date: 7/7/2006 5:41:41 AM
This regex is incomplete. How do it ends? Please specify.

Title: Regex incomplete
Name: ShArDiCk
Date: 8/25/2005 11:42:21 AM
This regexp is incomplete.. How do it ends?

Title: BTW
Name: Jonathan
Date: 10/8/2003 6:41:51 PM
By the way, the pattern described above (25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9]) matches substrings "0" to "255". But the pattern (25[0-5]|2[0-4][0-9]|1[0-9]{1,2}|[1-9]) matches "1" to "255". So, if you want for example to restrict *.*.*.0 addresses you would use the syntax (<0_to_255>\.){3}(<1_to_255>), so as to get ((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9]{1,2}|[1-9])

Title: Grouping...
Name: Jonathan
Date: 10/8/2003 6:27:24 PM
Try to group your sub-masks... for an IPv4 address, you would get: (<bytemask>)(\.<bytemask>){3} Same thing for use of classes for byte masks - compare: yours: (25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]) better: (25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9]) Also, leading "0" are used for octal representations of a byte; one is allowed through the third byte of your typical IPv4 sub-mask, but not for other bytes. For instance:, which is treated as, would match; but not

Copyright © 2001-2018, | ASP.NET Tutorials