x Hint: Register, if you want to hide ads.
x Did you like it? Well, then please consider making a donation :)

Regex Tag - dns

IP Address (IPv4) Regex .NET

Regular expressions are very commonly used by any developer no matter what language he's writing his program. Today I'll show the most useful Regex that sooner or later you will need them. For c# or vb.net. You want to check whether a certain string represents a valid IPv4 address in 255.255.255.255 notation. Optionally, you want to convert this address into a 32-bit integer.

Type: match, Date: 7/28/2015 11:40:12 AMAuthor: stackoverflow

Get IP address - simple non capturing example

?: is used when you want to group an expression, but you do not want to save it as a matched/captured portion of the string. An example would be something to match an IP address: (?:\d{1,3}\.){3}\d{1,3} Note that I don't care about saving the first 3 octets, but the (?:...) grouping allows me to shorten the regex without incurring the overhead of capturing and storing a match.

Type: match, Date: 7/12/2015 3:29:13 PMAuthor: stackoverflow