RegExLib.com - The first Regular Expression Library on the Web!

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find IPv4, udp/norm protocol with port
Expression
^(udp|norm)://(?:(?:25[0-5]|2[0-4]\d|[01]\d\d|\d?\d)(?(?=\.?\d)\.)){4}:\d{1,6}$
Description
Based on ip regex listed in source. Expanded to require udp:// or norm:// protocol at the start and :12345 port number at the end (1-5 digits). Written to answer a forum question. Current limitations - only allows lowercase protocol names and doesn't block ports that start with 0.
Matches
norm://125.24.65.11:80 | udp://125.24.65.11:80
Non-Matches
125.24.65.11:80 | norm://125.24.65.11 | www.NotAnIp.com
Author Rating: Not yet rated. Matthew Harris
Source http://regexlib.com/REDetails.aspx?regexp_id=547
Your Rating
Bad Good

Enter New Comment

Title

Name

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

Copyright © 2001-2024, RegexAdvice.com | ASP.NET Tutorials