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

Popular posts from this blog

javascript - mongodb won't find my schema method in nested container -

r - url in CRAN extension manual -

c - how to symlink a shared object file (lib) -