<?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]);
}
- Output for 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.25, 8.4.1 - 8.4.12
- Array
(
[0] => 001122334455
)
Array
(
[0] => 001122334455
)
Array
(
[0] => 001122334455
)
preferences:
352.01 ms | 407 KiB | 5 Q