Partially implemented the preg_grep example