try this:
preg_match_all("/(<span>\d{4}<\/span>)/", $myinput, $myoutput);
please note this does not parse html. it looks for something that starts with <span>
then has 4 digits, then </span>
. A single space in there, and will fail.
use this one to get the 4 digits only
preg_match_all("/<span>(\d{4})<\/span>/", $myinput, $myoutput);
solved Find pattern in Html using regex [closed]