vin decoder regex


$text = 'hallo

VSSZZZGJZBR17SO76
servus
WVWZZZ1KZ6W612305
test
WVWZZZ1JZ3W386752


blabla';

preg_match_all('/(?[[0-9A-HJ-NPR-Z]{3})(?[0-9A-HJ-NPR-Z]{6})(?[0-9A-HJ-OPR-Z]{8})/m', $text, $matches);
print_r($matches);
Ergebnis:
Array
(
    [wmi] => Array
        (
            [0] => VSS
            [1] => WVW
            [2] => WVW
        )
    [vds] => Array
        (
            [0] => ZZZGJZ
            [1] => ZZZ1KZ
            [2] => ZZZ1JZ
        )
    [vis] => Array
        (
            [0] => BR17SO76
            [1] => 6W612305
            [2] => 3W386752
        )
)

War dieser Artikel hilfreich?