<?php

preg_match('#data:image/\w+;base64,\K[^"<]*#i', '<img src="data:image/png;base64,_BASE_64_DATA_HERE"><br>', $match);
echo $match[0];
