I have string
$s = 'Sections: B3; C2; D4';
and regexp
preg_match('/Sections(?:[:;][\s]([BCDE][\d]+))+/ui', $s, $m);
Result is
Array
(
[0] => Sections: B3; C2; D4
[1] => D4
)
How I can get array with all sections B3, C2, D4
I can't use preg_match_all('/[BCDE][\d]+)/ui'
, because searching strongly after Sections:
word.
The number of elements (B3, С2...) can be any.