regex - How to use PHP preg_match for text between a colon and period? -
regex - How to use PHP preg_match for text between a colon and period? -
i have string:
$style = "width:87.0%;";
how utilize php preg_match() extract "87" it? life of me can't head wrapper around regex :(
preg_match('/:(.*?)\./', $style, $matches); echo $matches[1];
the ?
makes regex reluctant/ungreedy
php regex preg-match
Comments
Post a Comment