3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "001122334 001122334455 0011 0011223344556677"; if (preg_match_all('/\b[a-fA-F0-9]{12}\b/', $string, $matches)) { print_r($matches[0]); } if (preg_match_all('/(?<!\S)[a-fA-F0-9]{12}(?!\S)/', $string, $matches)) { print_r($matches[0]); } if (preg_match_all('/(?<![a-fA-F0-9])[a-fA-F0-9]{12}(?![a-fA-F0-9])/', $string, $matches)) { print_r($matches[0]); }

preferences:
24.66 ms | 405 KiB | 5 Q