3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $string = '192.168.0.50 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. 192.168.0.351 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea 192.168.0.52 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.'; preg_match_all('/([0-9]{1,3}\.){3}[0-9]{1,3}/', $string, $matches); var_dump($matches[0]);
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.13.2, 7.0.0 - 7.1.0
array(3) { [0]=> string(12) "192.168.0.50" [1]=> string(13) "192.168.0.351" [2]=> string(12) "192.168.0.52" }