<?php $string = 'I-like-candy-and-foo-bar-sandwiches'; var_export(preg_split('~(?<!foo)-(?!bar)~', $string));
You have javascript disabled. You will not be able to edit any code.