Displaying page
of
pages;
Items to
Title |
Test
Details
Pattern Title
|
Expression |
^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$
|
Description |
This matches an IP address, putting each number in its own group that can be retrieved by number. If you do not care about capturing the numbers, then you can make this shorter by putting everything after ^ until immediately after the first \. in a group ( ) with a {3} after it. Then put the number matching regex in once more.
It only permits numbers in the range 0-255.
|
Matches |
0.0.0.0 | 255.255.255.02 | 192.168.0.136
|
Non-Matches |
256.1.3.4 | 023.44.33.22 | 10.57.98.23.
|
Author |
Rating:
Andrew Polshaw
|
Displaying page
of
pages;
Items to