<?php $string = '100 grams almonds (preferrably raw) && 1 egg'; var_export( preg_match_all( '/\w+(?: && \d+| \([^)]+\))*/', $string, $m ) ? $m[0] : [] );
You have javascript disabled. You will not be able to edit any code.