<?php $barcode = ']d201070462608682672140097289158930[GS]10101656[GS]17261130'; preg_match_all('/^]d2(?: 01(?P<g01>.{14})| 10(?P<g10>(?:(?!\[GS]).){1,20})(?:\[GS]|$)| 17(?P<g17>.{6})| 21(?P<g21>(?:(?!\[GS]).){1,20})(?:\[GS]|$) )+$/x', $barcode, $matches); print_r($matches);
You have javascript disabled. You will not be able to edit any code.