Title |
Test
Find
IPv4 Address match
|
Expression |
(?:^|\s)([a-z]{3,6}(?=://))?(://)?((?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.(?:25[0-5]|2[0-4]\d|[01]?\d\d?))(?::(\d{2,5}))?(?:\s|$) |
Description |
Address match with optional match of protocol and port. Use case-insensitive. The matching brackets are:
bracket 1 = optional protocol without :// -- bracket 3 = IPv4 address, with a more likely correct number range -- bracket 4 = optional port without : as an separator. Should work fine. |
Matches |
192.168.12.34 | 192.168.12.34:8080 | Link: https://202.133.76.34:80 | ftp://77.66.5.4 |
Non-Matches |
262.133.76.34:80 | 262.133.76.34:1 | https:// 202.133.76.34:80 (matches not the protocol 'cos of the space) |
Author |
Rating:
Not yet rated.
Gerry
|
Source |
|
Your Rating |
|
Title: Port can start with 0
Name: rtpHarry
Date: 10/28/2009 1:40:03 PM
Comment:
I just tested it and it lets the port start with a 0 such as :080 which is incorrect I think?