#APL(NARS) 58 chars, 116 bytes {'...'≢⍵∼⎕D:0⋄4≠≢w←⍵⊂⍨⍵≠'.':0⋄w≢⍕¨⍎¨⍕¨m←⍎¨w:0⋄256≤⌈/m:0⋄1} test: p←{'...'≢⍵∼⎕D:0⋄4≠≢w←⍵⊂⍨⍵≠'.':0⋄w≢⍕¨⍎¨⍕¨m←⍎¨w:0⋄256≤⌈/m:0⋄1} a←'1.160.10.240' '192.001.32.47' '1.2.3.' '0.00.10.255' '1.2.$.4' '255.160.0.34' '.1.1.1' '1..1.1.1' '1.1.1.-0' '.1.1.+1' '1 1 1 1' '1' '10.300.4.0' '10.4F.10.99' 'fruit loops' '1.2.3.4.5' '0.0.0.0' '0.0 0.0.' '1.23..4' '1:1:1:1:1:1:1:1' {⍞←'[',⍵,'=',(p ⍵),']'⋄⍬}¨a [1.160.10.240= 1 ][192.001.32.47= 0 ][1.2.3.= 0 ][0.00.10.255= 0 ][1.2.$.4= 0 ][255.160.0.34= 1 ][.1.1.1= 0 ][1..1.1.1= 0 ][1.1.1.-0= 0 ][.1.1.+1= 0 ][1 1 1 1= 0 ][1= 0 ][10.300.4.0= 0 ][10.4F.10.99= 0 ][fruit loops= 0 ][1.2.3.4.5= 0 ][0.0.0.0= 1 ][0.0 0.0.= 0 ][1.23..4= 0 ][1:1:1:1:1:1:1:1= 0 ]