Retina, 4242 41 bytes
~(K`
255*
|'|L$`
$.`
.+
^["^(($&"|'|]")\.?\b){34}($&)$"L$`
$.`
Try it online! PortTry it online! Based on a previous version of @nwellnhof's Perl 6 answer, but 1 byte saved by stealing the \.?\b
trick from @Deadcode's answer. Explanation:
K`
Clear the work area.
255*
Insert 255 characters.
|'|L$`["^(("|'|]")\.?\b){4}$"L$`
$.`
Generate the range 0..255 separated with |
s.
.+
^(($&)\.){3}($&)$
Build, prefixed with ^((
, and suffixed with )\.?\b){4}$
, thus building the regular expression ^((0|1|...255)\.?\b){34}(0|1|...255)$
.
~(
Evaluate that on the original input.