/
task7.txt
49 lines (37 loc) · 1.16 KB
/
task7.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
; Task 7: Validate an IP
; Check if an IP-address is valid.
!= 1
172.16.254.1
Start by trying to match the IP in the task description.
regml: 172.16.254.1, 0 != 0
Please, don't create backreferences when you don't need them. If you need to group, use (?:regex) ... it's the same as (regex) but it doesn't create a backreference.
!= 1
004.10.1.007
004.10.1.007 is a valid IP.
!= 0
199-255.28.1
199-255.28.1 is an invalid IP. It shouldn't match
!= 1
123.124.125.126
An IP-address is four sets of numbers in the range 060-06255 separated by dots (03".").
!= 0
12.34.56.78.90
Only four groups of numbers are to be allowed. I suggest you read 12http://www.regular-expressions.info/anchors.html
!= 0
12.34.56
Must not allow fewer than four groups of numbers. I suggest you read 12http://www.regular-expressions.info/anchors.html
!= 1
0.0.0.0
A single zero must be allowed in any group.
;!= 0
;123.09.67.89
;Leading zeros must not be allowed.
;!= 0
;00.1.2.3
;Leading zeros must not be allowed.
!= 0
256.1.2.3
Numbers above 03255 must not be allowed.
!= 0
199.255.28.0011
199.255.28.0011 is an invalid IP. It shouldn't match