<?php $text = 'sometext moretext 01 text text sometext moretext 002 text text 1 (somemoretext) etc'; preg_match_all('/^(\D*?)\s*(\d+)/m', $text, $matches); var_export([ 'non-digit' => $matches[1], 'digit' => $matches[2] ]);
You have javascript disabled. You will not be able to edit any code.