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

web services - java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer -

Accessing MATLAB's unicode strings from C -

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